Problem uploading larger files

  • 12 years ago

    <pre>

    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 : mscorlibat 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 = fNameEnd If Since the path works fine for smaller files,m sure that there is no problem with the path.Am I missing something ????

     

    </pre>

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov