Asp.net and uploading large files
-
I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party
-
I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party
It may helps you
string filename = fuUploadVideo.FileName;
string path = Server.MapPath("Uploads4");
string strFinalFileName = Path.GetFileName(fuUploadVideo.FileName);
long FileLength = fuUploadVideo.PostedFile.ContentLength;
long uploadchunklimit;
int SizeLimit = (int)FileLength;
if (FileLength <= 1024)
{
uploadchunklimit = 1;
SizeLimit = (int)FileLength;
}
else if (FileLength > 1024)
{
uploadchunklimit = FileLength / 1024;
SizeLimit = 10;
}
else if (FileLength <= 10240 && FileLength > 1024)
{
uploadchunklimit = FileLength / 1024;
}
else
{
uploadchunklimit = FileLength / 1024;
}long lngSize = (long)SizeLimit; lngSize = 1024 \* 1024; string ext = Path.GetExtension(fuUploadVideo.PostedFile.FileName); fuUploadVideo.PostedFile.SaveAs(Server.MapPath("~\\\\Uploads4\\\\" + filename));
-
It may helps you
string filename = fuUploadVideo.FileName;
string path = Server.MapPath("Uploads4");
string strFinalFileName = Path.GetFileName(fuUploadVideo.FileName);
long FileLength = fuUploadVideo.PostedFile.ContentLength;
long uploadchunklimit;
int SizeLimit = (int)FileLength;
if (FileLength <= 1024)
{
uploadchunklimit = 1;
SizeLimit = (int)FileLength;
}
else if (FileLength > 1024)
{
uploadchunklimit = FileLength / 1024;
SizeLimit = 10;
}
else if (FileLength <= 10240 && FileLength > 1024)
{
uploadchunklimit = FileLength / 1024;
}
else
{
uploadchunklimit = FileLength / 1024;
}long lngSize = (long)SizeLimit; lngSize = 1024 \* 1024; string ext = Path.GetExtension(fuUploadVideo.PostedFile.FileName); fuUploadVideo.PostedFile.SaveAs(Server.MapPath("~\\\\Uploads4\\\\" + filename));
Thank you for your reply, but I don't understand how this code helps me
-
I'm using Asp.net 3.5 on Godaddy, and I need a way for users to upload large files using Asp.net FileUpload Control, I don't want to use a third party I've changed the value of maxRequestLength in web.config as follows: but when uploding a file of about 32 MB, upload process goes well (I can see percentage for the process in the down-left corner of Chrome browser), but after a while, the process restarts !! and after going with upload for a while page crashes without errors (just telling me that page cannot be displayed) The same happens on IE (but of course without percentage) Please help me to solve this issue without third party
you can use fileuploader control
-
you can use fileuploader control
Do you mean FileUpload control? Have you read my original post???