Download large files not working

Mohamed abdelrahman

hello i try to download files larger than 10M but files not downloaded

only pdf files are opend and other extensions (downloaded 0 bytes)

here is my code

public ActionResult DownloadFile(string fileName)
        {
            string path = Path.Combine(Server.MapPath("~/Files/PageItem/"), fileName); 

            byte[] fileBytes = new byte[0];

            if (System.IO.File.Exists(path))
            {
                fileBytes = System.IO.File.ReadAllBytes(path);
            }

            return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);

        }

and here is my Webconfig file

 <system.web>
    <customErrors mode="Off" />
    <compilation targetFramework="4.5" debug="true"/>
    <httpRuntime targetFramework="4.5" maxRequestLength="1048576" executionTimeout="3600"/>
  </system.web>

note that i checked uploded files at server and they are correct size and format what is wrong with me ??? and why only large pdf files that opens and no other extension

IndieTech Solutions

By default IIS file size limit is 4MB. try to add this to your web.config (the example to allow 20MB files)

 <security>
<requestFiltering>
    <requestLimits maxAllowedContentLength="20971520" />
</requestFiltering>
  </security>

edit1: You might check the request length size as well

 <configuration>
    <system.web>
         <httpRuntime executionTimeout="110" maxRequestLength="20000" />
    </system.web>
</configuration>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Download large files in Dartlang

From Dev

Download large files in Dartlang

From Dev

Working with large text files?

From Dev

php download fails on large files

From Dev

Download large files using a memorystream

From Dev

Working with a large amount of really large files in PHP

From Dev

Not able to download small files but can download large files

From Dev

Download large number of files in background in iOS

From Dev

Download large files using ftp protocol

From Dev

Download Large Google-Drive Files

From Dev

Rails + thin: Not possible to download large files

From Dev

how can download large files in chunks

From Dev

Download large files using ftp protocol

From Dev

Download large files using large byte array causes "Out of memory"

From Dev

GAE - urlfetch multipart post not working with large files

From Dev

Zip PDF-Files download not working

From Dev

Java code to download files from Artifactory not working

From Dev

How to download (stream) large files in symfony2

From Dev

How to download large sized Files (size > 50MB) in java

From Dev

how can I use wget to download large files?

From Dev

download, process, upload large number of s3 files with spark

From Dev

Powershell Write-Progress bar not working on large files

From Dev

Big files download through php function readfile not working

From Dev

Phonegap iOS Download files from online to local file system not working

From Dev

Picasso large image download

From Dev

Picasso large image download

From Dev

Download M total files with N simultaneous Async HTTP clients, where M is large and N is configurable

From Dev

What is the fastest way to download large files from S3 to EC2 in same region?

From Dev

Is it possible to download extremely large files intelligently or in parts via SSH from Linux to Windows?

Related Related

  1. 1

    Download large files in Dartlang

  2. 2

    Download large files in Dartlang

  3. 3

    Working with large text files?

  4. 4

    php download fails on large files

  5. 5

    Download large files using a memorystream

  6. 6

    Working with a large amount of really large files in PHP

  7. 7

    Not able to download small files but can download large files

  8. 8

    Download large number of files in background in iOS

  9. 9

    Download large files using ftp protocol

  10. 10

    Download Large Google-Drive Files

  11. 11

    Rails + thin: Not possible to download large files

  12. 12

    how can download large files in chunks

  13. 13

    Download large files using ftp protocol

  14. 14

    Download large files using large byte array causes "Out of memory"

  15. 15

    GAE - urlfetch multipart post not working with large files

  16. 16

    Zip PDF-Files download not working

  17. 17

    Java code to download files from Artifactory not working

  18. 18

    How to download (stream) large files in symfony2

  19. 19

    How to download large sized Files (size > 50MB) in java

  20. 20

    how can I use wget to download large files?

  21. 21

    download, process, upload large number of s3 files with spark

  22. 22

    Powershell Write-Progress bar not working on large files

  23. 23

    Big files download through php function readfile not working

  24. 24

    Phonegap iOS Download files from online to local file system not working

  25. 25

    Picasso large image download

  26. 26

    Picasso large image download

  27. 27

    Download M total files with N simultaneous Async HTTP clients, where M is large and N is configurable

  28. 28

    What is the fastest way to download large files from S3 to EC2 in same region?

  29. 29

    Is it possible to download extremely large files intelligently or in parts via SSH from Linux to Windows?

HotTag

Archive