locked
FreeTextBox --> ImageGallery used for Newsletters RRS feed

  • Question

  • User896256136 posted

     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


    Tuesday, April 20, 2010 7:54 AM

Answers

  • User896256136 posted

    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


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 5:31 AM

All replies

  • User177399542 posted

    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

    Wednesday, April 21, 2010 7:24 AM
  • User896256136 posted

    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


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 5:31 AM