I need some advice. I'm creating a page where the admin can create a Newsletter with the FreeTextBox. The Admin wants to have the opportunity to upload some Images from his harddisk. So I added the ImageGallery. This is working just fine BUT I have one
remark. When she sends the newsletter out, what about those images? Because they are refered to the images saved onto the server: "../images/image1.jpg".
Can somebody give me advise how I have to take care of this?
/// Use this to save file in your website folder(temproray)
FileUpload1.SaveAs(Server.MapPath("~/YOUR-FOLDER-NAME//" +strFileName));
// to get file path from the websit folder
string strNewPath = Server.MapPath("~/YOUR-FOLDER-NAME//" + strFileName);
// Now fetch images from this path
// to Delete temporary saved file from the folder
System.IO.FileInfo fileInfo = new System.IO.FileInfo(strNewPath);
if (fileInfo.Exists)
{
fileInfo.Delete();
}
Member
4 Points
29 Posts
FreeTextBox --> ImageGallery used for Newsletters
Apr 20, 2010 07:54 AM|Anneleen Verstreken|LINK
Hi,
I need some advice. I'm creating a page where the admin can create a Newsletter with the FreeTextBox. The Admin wants to have the opportunity to upload some Images from his harddisk. So I added the ImageGallery. This is working just fine BUT I have one remark. When she sends the newsletter out, what about those images? Because they are refered to the images saved onto the server: "../images/image1.jpg".
Can somebody give me advise how I have to take care of this?
Thanks in advanced!
Kind regards
Anneleen
FreeTextBox ImageGallery Newsletters
Contributor
7095 Points
1966 Posts
Re: FreeTextBox --> ImageGallery used for Newsletters
Apr 21, 2010 07:24 AM|anuj_koundal|LINK
string strFileName = FileUpload1.FileName.ToString();
/// Use this to save file in your website folder(temproray)
FileUpload1.SaveAs(Server.MapPath("~/YOUR-FOLDER-NAME//" +strFileName));
// to get file path from the websit folder
string strNewPath = Server.MapPath("~/YOUR-FOLDER-NAME//" + strFileName);
// Now fetch images from this path
// to Delete temporary saved file from the folder
System.IO.FileInfo fileInfo = new System.IO.FileInfo(strNewPath);
if (fileInfo.Exists)
{
fileInfo.Delete();
}
USe this
Asp .Net Tutorials | www.codingfusion.com
Bank IFSC Codes
Ajax Control Toolkit
Member
4 Points
29 Posts
Re: FreeTextBox --> ImageGallery used for Newsletters
Apr 22, 2010 05:31 AM|Anneleen Verstreken|LINK
Hi,
This is indeed a possible sollution but I just changed my coding when I want to send the email
Replace (body, "../my website/", "http://www.my website.com/")
Kind Regards
Anneleen