0

I am trying to upload image in my website folder, but it is not uploading.
In my database I have "Photographs" column for storing image names and I store images in images/1/. Where images folder is at root level of website. On my localhost it is working perfectly fine, but same is not happening on my webserver.
If I skip photograph upload, all values are inserted properly. But otherwise nothing gets inserted.
Below is my code:

       //this part works fine

        dr["EmailAddress"] = txtEmail.Text;
        dr["LoginEmailAddress"] = txtUserName.Text;
        dr["Password"] = txtPassword.Text;
        dr["IsAgent"] = rdAgent.Checked;
        dr["IsManager"] = rdManager.Checked;

        //below is code to upload photograph, where photograph is column name in 
        //database and working fine on localhost

       if(URLMessage.URLAction ==URLAction.update )
            dr["Photograph"] = WebHelper.SaveUploadFile(1, flPhoto, dr["Photograph"], lblRemove .Text .Equals ("Upload"));
        else 
            dr["Photograph"] = WebHelper.SaveUploadFile(1,flPhoto, dr["Photograph"], true);

My web.config is as follows:

        <appSettings>
        <add key="connectionString" value="Data Source=localhost;Initial Catalog=dbABC;user id=abc; password=kashmirmed@123#;" />
        <add key="siteFileURL" value="abc.in/images/" />
        <add key="SiteFileFolder" value="abc.in\images\1\" />
        </appSettings>

Where abc.in is website name

4

0 回答 0