Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

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

$
0
0
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%>


Viewing all articles
Browse latest Browse all 13329

Trending Articles