Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Larger file upload works locally only in .net

Reply
Thread Tools

Larger file upload works locally only in .net

 
 
anands anands is offline
Junior Member
Join Date: Jul 2008
Posts: 1
 
      07-08-2008
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 ????
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to upload file to DB works locally but fails on production se Raj ASP .Net 4 07-15-2009 02:10 PM
Download file works locally, but not on server - Any idea? Carlos Lozano ASP .Net Security 2 06-18-2007 09:08 PM
Question: Can I make textarea larger (larger text)? Peter Williams HTML 1 06-03-2005 08:17 AM
20" LCD: setting 4 g Larger text in all Programs? and larger icons lbbss Computer Support 6 04-14-2005 05:46 PM
Unable to upload images larger than 131 071 bytes Shawn ASP .Net 6 03-02-2005 08:15 PM



Advertisments