1

I'm having problems when I download files bigger than 5mb (until 10mb this is the limit by me).

I just got a 0 byte file. It's like the file is empty, BTW, the file is uploaded correctly on the db. Checked that using the tsql datalength()

This is my code:

    <%
Response.Buffer = false
ssql = "select name, filestore from files where id=" & request("idfile")
                    Set oRs = Server.CreateObject("ADODB.Recordset")
                    oRs.Open ssql, Application("myConn")



    If Not ors.EOF Then
             Response.AddHeader "Content-Disposition", "filename=""" & ors("Name") & """"

                Response.ContentType = "application/unknown"
        Response.BinaryWrite oRs("filestore")
        Response.end
      End If


      ors.Close
      Set ors = nothing %>

Any Idea???

srecce
  • 97
  • 3
  • 15
  • 2
    this might help http://stackoverflow.com/questions/1989334/how-do-i-enable-upload-of-large-files-in-classic-asp-on-iis-7 – Andrew Jun 19 '14 at 20:11
  • 2
    This might help too: http://stackoverflow.com/questions/21740443/classic-asp-iis-6-response-buffer-limit-exceeded/21748715 – VMV Jun 20 '14 at 07:33
  • 1
    @Andrew Your comment linked to a post about increasing the upload (request) limit for Classic ASP. The OP is writing a page to allow users to download from a page and stream the file out of a database. – Lynn Crumbling Jun 20 '14 at 13:42

1 Answers1

1

Thanks for the answers guys. I finally found the problem. It was on IIS related to the asp buffer limit. Increasing that setting worked fine.

srecce
  • 97
  • 3
  • 15
  • 1
    Thats one approach the more sensible one however is to use the `ADODB.Stream` object to stream the data put in meaningful chunks that never max out the Response Buffer Limit. – user692942 Jun 21 '14 at 23:12