If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Response... Generating message "...is either not a supported file type"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Oct 2003
Location: London
Posts: 325
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%>
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Oct 2003
Location: London
Posts: 325
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On