简体   繁体   中英

system.out of memory exception in file upload

I want to upload a file size of 1 GB with ASP.NET . I Write This Code

 Dim bytes(up_FileImage.UploadedFiles(0).ContentLength) As Byte
                    bytes = File.ReadAllBytes(Path.Combine(Request.PhysicalApplicationPath, "App_Data/", ViewState("DirectoreName").ToString(), up_FileImage.UploadedFiles(0).FileName))
                    itemDocFile.FileImage = bytes

and in web.config Write this Code

<httpRuntime maxRequestLength="102400" executionTimeout="3600"/>

but in First Line I Get this Error

system.out of memory exception

Please Help Me. Thanks All

Uploading a file that large is unadvisable. Here's some alternatives: https://stackoverflow.com/a/17904718/902874

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM