开发者

How to upload pdf file in asp.net

开发者 https://www.devze.com 2023-01-26 16:31 出处:网络
When I upload pdf file using my asp.net web app, I get that is Error 101 (net::ERR_CONNECTION_RESET开发者_如何学Python): Unknown error.This is not due to the file type, but the file size.By default, u

When I upload pdf file using my asp.net web app, I get that is Error 101 (net::ERR_CONNECTION_RESET开发者_如何学Python): Unknown error.


This is not due to the file type, but the file size. By default, uploads are limited to 4 MB. Update web.config to increase your maximum request length. For example, setting maxRequestLength to 102400 will allow you to accept up to 100 MB; just be sure you want to allow that much data to be posted to your server.

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="size in kb" />
  </system.web>
</configuration>


I think before file upload you should clear your browsing data in your browser.

Just use simple Save as method of file upload control to upload pdf file.

FileUpload1.SaveAs(Path where to save pdf file)
0

精彩评论

暂无评论...
验证码 换一张
取 消