Larger file upload works locally only in .net

Discussion in 'General Computer Support' started by anands, Jul 8, 2008.

  1. anands

    anands

    Joined:
    Jul 8, 2008
    Messages:
    1
    I'm trying to upload files on the server (running IIS) using <input type=file name=myfile> in my ASP.net application (.net 2003).
    It works fine on local system but when I try this on the server it uploads only small files of size max 50Kb.Attempts to upload larger file end up with an error saying :
    Could not find a part of the path "C:\Inetpub\wwwroot\myweb\Academic\". source : mscorlib
    at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at sdmsystem.Upload.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\myweb\Upload.aspx.vb:line 32 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()
    I have already made the following changes in my web.config file
    <httpRuntime executionTimeout="900" maxRequestLength="20000" /> and given full permissions on the folder to all users.
    But could not find a solution.
    I'm using the follwing code:

    If Request.Files.Count = 1 Then
    fName = myFile.PostedFile.FileName
    fName = Right(fName, (fName.Length - fName.LastIndexOf("\")) - 1)
    Dim FilePath As String
    FilePath = Server.MapPath("")& "\Academic\" & fName
    myFile.PostedFile.SaveAs(FilePath)
    lblMsg.Text = fName
    End If

    Since the path works fine for smaller files,m sure that there is no problem with the path.Am I missing something ????
     
    anands, Jul 8, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sterling.metz

    not receiving e-mail from out of state, only locally

    sterling.metz, Mar 30, 2005, in forum: Computer Support
    Replies:
    1
    Views:
    544
    Blinky the Shark
    Mar 30, 2005
  2. lbbss
    Replies:
    6
    Views:
    970
    ┬░Mike┬░
    Apr 14, 2005
  3. Adriano
    Replies:
    1
    Views:
    930
    mark mandel
    Dec 15, 2003
  4. Fogar
    Replies:
    1
    Views:
    702
    Erick
    Jan 17, 2006
  5. Upmanyu
    Replies:
    0
    Views:
    945
    Upmanyu
    Mar 27, 2008
Loading...

Share This Page