I am working on a web page which creates a .PDF file dynamically using CETE Dynamic PDF. This is saved in a memory stream. I then save that file as a .zip using DotNetZip in a memory stream. The resultant zip file is used as an attachment
for an Outlook email message. The problem comes when trying to extract the .zip file in the Outlook email message. I get the following error:
An unexpected error is keep you from copying the file. ... Error 0x80070057: the parameter is incorrect.
If I then press the "Try Again" button, I get a message about copying the file. "There is already a file with the same name in this location." I may "copy and replace", "don't copy "or "copy
but keep both files." The only choice that doesn't get another message is to not copy. I don't know why it is trying to copy and how to avoid the message.
This is the code I am using:
'put the PDF file into a .zip format
Using zip As ZipFile = New ZipFile
zip.ZipErrorAction = ZipErrorAction.Skip
' move the stream position to the beginning
'Quote with any merged documents
oAttachment(0) = New System.Net.Mail.Attachment(oZipStream, sZipFileName)