Hi,

I have this fileupload control which saves excel file on my server, but somehow, if the excel file is larger than 4 mb it does not save the file, i used this code
fileupload1.SaveAs

can you please help me on why does this happen?

Thanks

Recommended Answers

All 5 Replies

Could be that some servers do Not allow files to be uploaded If greater in size than 4MB. Check w/your web.host provider.

Could be that some servers do Not allow files to be uploaded If greater in size than 4MB. Check w/your web.host provider.

where could i find the web.host provider? thanks

"web.host provider" is someone as justhost.com, my web.host provider.

I did a quick google search and located this:

If you try to upload some file of more than 4 mb you will get and error. This is the default file size limit of dot net. This is defined in Machine.config. You can overwrite this in web.config. Like this...

http://www.eggheadcafe.com/community/asp-net/17/10297761/error-on-fileupload-contorl.aspx

For future references, If regarding ASP.NET, Then post on the ASP.NET forum.

Hope this helps.:)

For future reference, you can use an ASP.NET control like FileUltimate. It abstract the browser and server upload limitations for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.