Author |
|
caussin Newbie
Joined: 06 January 2009 Location: France
Online Status: Offline Posts: 6
|
Posted: 28 January 2009 at 8:41am | IP Logged
|
|
|
Hello,
i am working on a web application that displays html emails, using GetHtmlAndSaveRelatedFiles combined with .Parser.WorkingFolder to extract the attachments into a working folder, then into a sub folder made with a MD5 name.
Every thing works fine. The main call is :
Dim ReworkedHTMLBody As String = Msg.GetHtmlAndSaveRelatedFiles("WBGetEmailPart.ashx?", VirtualMappingType.Dynamic, MessageFolderBehavior.CreateOnly)
i use the CreateOnly option because it is a web application and these files need to be accessed even when the ASP.NET call is finished... as you adviced.
The only problem is that each subsequent call to the code for the same email (if the user refreshes the page for example) writes again and again the attachment files (with [1]... [2]... extensions).
is there a way to avoid that ? Knowing that each email is using a specific folder (whose name is made with MD5), what's the point writing the same attachment again and again, and not re-use the initial file ?
Thanks for your answer.
Olivier
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 29 January 2009 at 5:38am | IP Logged
|
|
|
The point of not re-using the initial file is that multiple different messages can be saved into the same folder and if they have attachments with equal names, they'll overwrite each other. You may implement deleting all files in the appropriate folder prior to GetHtmlAndSaveRelatedFiles call.
Best regards,
Andrew
|
Back to Top |
|
|