Error in adoStream.Read()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jennisy
    New Member
    • Dec 2009
    • 1

    Error in adoStream.Read()

    Hi, all,

    There is a problem that during download file, if the file size is greater than 800kb, 500 error popup. But it is OK, if the file is less than 800kb.

    Can anyone give me a advice? Thanks in advance.

    The asp runs on II6, windows 2003 and AspBufferingLim it in windows\system3 2\inetsrv\metab ase.xml has been updated to 20480000.

    Here's the asp script:
    Code:
    if request.querystring("loadType") = "FILE" then
            'Upload.SendBinary resultFilePath,True,rs("PMEVR_TYPE"),False
                'Response.ContentType = "application/x-unknown" ' arbitrary
                Response.ContentType = "application/pdf" ' arbitrary
                'Response.AddHeader "Content-Disposition", "attachment; filename="  & rs("PMEVR_PM_FILPTR")    
                Set adoStream = CreateObject("ADODB.Stream") 
    	    adoStream.Open() 
    	    adoStream.Type = 1 
    	    adoStream.LoadFromFile(resultFilePath) 
    	    Response.BinaryWrite adoStream.Read() 
    	    adoStream.Close 
    	    Set adoStream = Nothing 
    	    Response.End 
    end if
    regards,
    JY
    Last edited by jhardman; Dec 28 '09, 03:41 PM. Reason: added code tags
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    you could try turning the response buffer off completely, not sure if that will help or not. Try linking to the file directly in a static page, if you have the same issue then the problem is in IIS, if not then it is an ASP issue.

    Jared

    Comment

    Working...