473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sending binary file (PDF) over SSL using ASP script

Hello,

Here's a quick explanation & problem:

i have an ASP (iis v5.0) application that generates a pdf file and this file
is saved to the server. it is saved in a location not available to web
users. i have an asp script (below) that sends the pdf file to the user as a
binary stream. So that the user specifies which file to upload, the script
performs some security checking and if it passes, it sends the pdf document.

This works great in HTTP, but i want to do this using SSL. When i try the
same thing over SSL, it gives me a 'File Download' dialog box with Open,
Save, Cancel, More Info. The file name is the name of my script and file
type is 'Adobe Acrobat Control for ActiveX'.

When i click Save or Open i get an error message: Internet Explorer cannot
download [scriptname] IE was not able to open this Internet site. The
requested site is either unavailable or cannot be found. Please try again
later.

The key to all this is that the report can change and i need to make sure
the data doesn't get cached along the way. Hence there are a bunch of header
manipulation commands included in the send function.

Any help would be much appreciated.

Rgds,
yt

PDFSend.asp >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<%
Function getBinaryFile( strFilePath )
Dim oStream

Set oStream = Server.CreateObject( "ADODB.Stream" ) ' Create the object
oStream.Open ' Open our file
oStream.Type = 1 ' 1 = Binary
oStream.LoadFromFile strFilePath ' Retreive binary data from the file

getBinaryFile = oStream.read ' Return the binary data to the caller

Set oStream = Nothing ' Destroy the ADO object
End Function

if blnSecurityPass Then
' SUCCESSFUL PASS - SHOW REPORT
Response.Clear
Response.Buffer = True
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Expires", "Mon, 1 Jan 2000 05:00:00 GMT"
Response.AddHeader "Last-Modified", Now & " GMT"
Response.Expires = -1
Response.ContentType = "application/pdf"

Response.BinaryWrite getBinaryFile( strFilename )

Response.End
End if
%>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Jan 24 '06 #1
0 1827

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Kubaton Lover | last post by:
I have a pdf file (syllabus.pdf) on the server. I have written the following PHP code. It correctly finds the file, but it is sending the file back as text I think because I'm seeing the binary...
2
by: Frostillicus | last post by:
I'm trying to get an ASP to return a zip file to the remote browser from an Image (BLOB) field in SQL Server 2000 but Internet Explorer keeps saying: Cannot open C:\Documents and...
5
by: AlexCDM | last post by:
Greetings; I'm a (young) .NET developer and I have this problem: I'm building an application (with C#) that creates PDF files. To display a JPEG image within the PDF I need to copy the data from...
4
by: Schwarty | last post by:
I hope I posted this to the correct group. If not, please let me know and I will get it posted in the correct section. I have a web application developed in ASP.NET using C# for the code behind....
1
by: news | last post by:
At the end of a PHP script, I'm sending a file via FTP to a server. I thought it'd be best to use a shell script in order to automate the FTP (logging in, changing to binary, putting the file,...
1
by: C#Schroeder | last post by:
I am working on a project where I have to take a binary file and convert it to a PDF file. The binary file is stored in a database as a Varbinary. What is the best way to store the binary file....
9
by: loudking | last post by:
Dear all, I am writing a client-server application and the client should upload a file to the server, then the server should display the content of the file in stdout. Because I have to deal...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
5
by: xmaverick | last post by:
Hello, I'm a newbie to perl and i'd like some assistance trying to figure out how to send an attachment using MIME::Lite. I have searched the net far and wide and have used and modify different...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.