Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    London
    Posts
    327

    ASP Response... Generating message "...is either not a supported file type"

    Hi,

    I'm attempting to send an asp page to a pdf document but no matter what I try, I'm getting an error message on the outputted pdf "Adobe reader could not open "test.pdf" because it is either not a supported file type, or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

    Could someone offer a suggestion as to where I'm going wrong? Also, where do I place this on my source code? I've gor the buffer and clear as the first lines on the page, then the next segment is just before my <HTML> tag, and the flush is after the </HTML> tag.

    If I open the pdf document via notepad, I do get the html coding of the document.

    Code:
    <%
    response.buffer = true
    response.clear %>
    
    <%
    response.AddHeader "Pragma", "no-cache"
    response.AddHeader "Cache-control", "private"
    response.Expires = "0"
    response.ContentType = "application/pdf"
    response.AddHeader "Content-Disposition", "attachment; filename=test.pdf"
    %>
    
    <%response.flush%>

  2. #2
    Join Date
    Oct 2003
    Location
    London
    Posts
    327
    I've just tried to create a test page using nothing other than the lines above and I'm still getting the same message so my problem is somewhere there I think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •