Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Attached files in e-mail marketing does not seem to work

Attached files in e-mail marketing does not seem to work

Søren Heide Larsen
Søren Heide Larsen
Reply

Version (installed through 9.2.15 zip):
Dynamicweb (9.2.15)
Dynamicweb.Mailing (1.0.0)
Dynamicweb.EmailMarketing (1.2.3)

Issue:
Though e-mail marketing did not report any error i tracked it down to being an issue with path combine where a '\' is missing.

Could not find a part of the path 'd:\xxxx\FilesTemp\test.pdf'

When I searched deeper I noticed that in your MailMerger you use something like this (decompiled)
string fileName = SystemInformation.MapPath("/Files/").Replace("\\", "/") + current.Remove(0, 1)

Which means that you expect SystemInformation.MapPath("/Files/") to end with '\', but as "/Files/" are resolved using your VirtualPaths where you add it like this through your GlobalAsaxHandler:
SystemInformation.AddVirtualDirectoryMapping("/Files", New DirectoryInfo(server.MapPath("/Files")))
Then the result will be without '\' thus leading to the error I get.

Solution
Update your Dynamicweb.Mailing to use Path.Combine instead of + and use TrimStart('\\') instead of Remove.

 


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You are completely right - TFS#36541 due in next hotfix.

BR Nicolai

Votes for this answer: 1
 
Søren Heide Larsen
Søren Heide Larsen
Reply

Sounds good :)

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Søren

The problem TFS#36541 "Use path combine instead of string concatenation" has now been fixed in version 9.2.17

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum