How to upload a file to the server ? Help

Discussion in 'ASP.NET 2.0' started by stephane, Oct 8, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi all
    I'm new on this forum
    Well i have a headache her I try to figure out
    my website is a video streaming website and I allow users to create their profile and upload their profile pictures to the server
    i have a dedicated folder on the server for that
    I set the folder path in the web.config as follow: <add key='profilePicturesFolder' value='~\\assets\\profile_pictures'/>
    and I use it in the code to get the path of that directory. string profilePicturesPath = HttpContext.Current.Server.MapPath(CConfig.GetProfilePhotosPath());
    So far so good. Now to get the pictures of the users I use the asp.net file upload control.
    So When I use the saveAs method of that upload control : photoUpload.PostedFile.SaveAs(profilePicturesPath + '//' + newFileName);
    it works fine on my localhost, but sadly does not work on the server.

    I really don't understand and Im kinda stuck here, I really need some help gyus

    Thanks so lot. In fact this is the url of that page http://www.abidjan4life.net/register.aspx
     
  2. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

    Welcome to the Community Forum stephane!

    What's the error message that you're receiving?

    Winston

    DiscountASP.NET
     
  3. It seems that after submit,your page is getting redirected to 'home.aspx'.Make sure that page is has the expected contents.I don't see any error message while submitting .

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page