Sending Binary File (PDF) Over SSL Using ASP Script

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. Code:

View Replies


ADVERTISEMENT

Binary File IO

What I would like to do is load a file's contents from a file on the server
and put the contents.

into a record in a database. For this I need to load the contents in binary
format into a

variable. Anywhere I looked, I've only found text I/O in ASP.
(FileSystemObject and TextStream).

How can I load any kinds of file into a byte array? Or is it enough to load
it as a text stream

and then treat the loaded string as a byte array?

View Replies View Related

Binary File Streaming

I have an exe file on a server that reads an XML file ( as a parameter) and generates a new file for downloading. However, most servers won't allow an exe file to create the new binary file. Is there any way that I can execute the exe file and have it download straight to the client instead of saving to the server?

View Replies View Related

Trying To Write To A Binary File

When I run an asp script, I can view the contents on the screen in pdf format. But instead of displaying the information to the screen, I want to be able to save the same information into a binary file with a pdf extension.
Does anybody know how to do that?

I have listed the coded that writes it to the screen, but now want to be able to write the information into a file ....

View Replies View Related

Read Binary File As Hex

I'm using ASP to generate an RTF (rich text) file, via the FSO. No problems with text, but when it comes to inserting images, the files have to be embedded as either binary or hex.

Try as I might, I can't get binary to work (Word b0rks trying to open the resulting file). When I create a simple RTF in Wordpad and then view its source, Wordpad seems to be embedding the image as hex. Does anyone have a suggestion as to how I could read an image file off the disk in hex format for writing into my RTF?

View Replies View Related

Creating Binary File

I need to extract some blobs (chm files, actually) from a database and save their contents on the server (recreate chm files).

I tried to do it in several ways (writing the contents to a stream and save the stream to file, writing the contents directly to file, I couldn't figure out how to do it by using the class ADODB.File) but none of them worked.

View Replies View Related

Downloading Zip File As Binary File

I use the following code in an asp.net page to download file from my site to the user:

Response.Buffer = True
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=""" & dsDocFile.Tables("tbl_DocFile").Rows.Find(FileID).Item("FileName") & """")
Response.Flush()
Response.WriteFile(sFileName)

This works with most every file type I've run across (jpg, gif, doc, ppt, xls, etc..). Normally when the user tries to access a file, a download window pops up asking the user whether he/she wants to open or save the file.

However, when the file is a zip file, the user just receives a blank screen instead of the usual download window. Has any one run into this problem? If yes, how did you resolve it?

View Replies View Related

Write Data To Binary File

I have one EXE file that customer need to download from my website. But I
have one text file of Max 250 bytes of text in in that I want to append to
the END of the Binary EXE file and give that for download to user. How can I
do that. Please suggest. I think we need to go for some BinaryWrite kind of
procedure using ADO Stream.

View Replies View Related

POSTing A Binary File Using Multipart/form-data

I'm trying to setup an ASP page to POST an image across to another page- essentially simulating what a browser does when you use <input type=file> in a HTML form.

I'm able to correctly setup the headers etc and do the POST, but I'm unable to include the binary data of the image.

The only way i've been able to do it is if I base64 encode the image. I'm using MSXML2.ServerXMLHTTP to do the POST, and I can't seem to do the .send with a form body that includes the binary data of the image. Code:

View Replies View Related

Sending A File Using ASP - Is This Efficient?

I have a guy asking me about the speed of downloads from his web site. I use
ASP code to send the download to the user, and the code I use is basically
like this:

FileName = Request.Form("FileName")
Path = Server.MapPath(FileName)
Set Upload = Server.CreateObject("Persits.Upload")
Upload.SendBinary Path
Set Upload = Nothing

Is there anything that can be done to make this more efficient and to send
the file faster?

View Replies View Related

Sending Zip File From Database Problems

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 SettingsFrostillicusLocal SettingsTemporary
Internet FilesContent.IE5U7GXENGFfile[1].zip

The URL to open the zip file is like this: doc_view.asp?id=1&ver=2

....where id and ver represent the zip file's version in the database. The
code I've pieced together to return the zip file is as follows (note: this
code works fine for PDF, JPG, DOC, XLS, GIF, and all sorts of files - just
not zip - HOWEVER, if I click "save" instead of "open" in the download box
then open the zip file manually, it works fine - Internet Explorer just
won't load WinZip for me automatically) Code:

View Replies View Related

Sending Email With Attached File From Form

i want to send an email from a web app with an attached file. the form is for users to enter email addresses to whom they want the attached file sent. I'm using ASP and CDONTS mail. Code:

View Replies View Related

Binary Streaming

Here is a written descripton of my webpage.
One frame split down the middle. The left side is the menu and the right
displays what is selected from the menu.

the user selects from the menu and on the right, clicks on "download image"
link. the user is presented with a download dialog box. The user saves the
image and when it is completed goes and selects another item from the menu.
But this time nothing happens.

It is like i have to refresh the page before anything works again. It is
like it is stuck on the ASP binary stream file that forced the download.

on my link i have

<a href="donwload.asp" target="right">download image</a>

How can i fix this?

View Replies View Related

Binary Files

I have many office files saved in sql server. The system sends them by one
web page: RequestFile.asp. So every file has the same name requestFile.asp.

How can i change requested URL on the server from
www.domain.com/requestFile.asp to www.domain.com/someFileName.doc????

I am able to rise "Save or open downloaded file" dialog

View Replies View Related

Using Binary Write

I am having trouble trying to output an image using Binary.Write. I have a page which displays a record. One of the fields is an image and I want to display this on the page.

My question is this: Is it possible to use the Binary write command i.e. Binary.Write("MyDatabaseField") on the same page that I want the image displayed on?

If not Is there a way to nest it inside an image tag as follows:

Response.Write("<img src=" & binaryWrite("mydatabasefield" & ">")

View Replies View Related

Binary Bit Masks

I'm working on a client project where i'm importing some data from a programme to a sql database.One of my fields contains a value which is created by bit flags Within this value are 10 bit flags, and i need to find out the value of each flag. An example of one of the bit flags is 0x0001

I'm guessing that it is to do with Binary and I need to apply a bit masks, but that's where my expertise ends.

View Replies View Related

Converting To Binary

I am using XMLhttp and responsebody to receive info from a webpage

I dont use responsetext since i need the international chars едц

The information I recieve is binary is there any fast way to convert the
binary data to text ?

I used this function but its slow compared to response.binarywrite
and i need the information in a string so I can alter it with my script.

So is there any way to convert Binary to Text just as fast as
response.binarywrite ?

Function BinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1
Next
BinaryToString =

View Replies View Related

Binary Read?

Does anyone know of a "pure ASP" upload script that does not use the binary read? I am sure many people are looking for this as well..as you cannot use the binary and request.form in the same script. I am trying to integrate a file upload into an already built script using request.form.

View Replies View Related

Binary Write

I'm having problems with a simple binary write. The page is just supposed to write a JPEG back to the browser but the image does not display (the "X" image shows).

Any help is appreciated. Here's the full code:

<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/jpeg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fl = fso.GetFile("c:afterWF.jpg")
Response.BinaryWrite fl
%>

View Replies View Related

Inserting Binary Files.

How can I insert a binary file into a SQL Server db using asp? It must be possible cause SQL Server has a datatype called "varbinary".

View Replies View Related

ASP Binary Data Transformation

I'm using ADODB.Stream to open a binary file on the server and write
it down to the browser using Response.BinaryWrite. It's working fine,
but i need to make some changes to the binary data before it is send
to the browser.

I'm trying to use REPLACE, but it's not finding a string that i know
it's in the binary file. Using InstrB i've found that the search
inside the binary data is being done in a Unicode format, but i don't
know how to make an ascii search&replace operation on binary data.

View Replies View Related

Streaming Binary Files

I am working on an app that needs to stream binary files(such as PDF or WORD docs) to the browser. I cannot just pass a URL pointing to the file directly. I've tried the following in an ASP file:
Code:

Response.ContentType = "application/doc"
Response.BinaryWrite strData

where strData contains the binary data content of the WORD file in a string variable (for PDF, I would set the content type to "application/pdf").
However, the browser displays the data itself, rather than hosting the doc in the appropriate browser applet.

View Replies View Related

Convert Binary To Octal

i have searched and can't seem to find how to do this
here it will ask the user to enter in a sequence of binary numbers that are separated by a period. For an IP there are 4 sets of 8 numbers that are separated by a period; 32 numbers, 3 periods. Once the user entered 0 and 1 i have to somehow convert that to octal and display the result on a new page with the octal answer.

View Replies View Related

Send PDF As Binary To The Browser?

I need to perform a task where I read PDF file on the server and send it to the client without using Redirect.

The problem is that As far as I have read ASP and VBscript does not have a support for reading binary files so I need to use external dll developed in VB but the hosting company does not Let me register the dll. I there any other way to send pdf file to the client???

View Replies View Related

Binary Output Retrieved From Db

I'm attempting to read data written to a MySQL database and view it in the browser. I've searched the net for over 3 days and I've seen many posts that say it works great, but it's not working for me. The only thing that displays properly is a text file. Everything else is garbled. I desire to store & read PDF files though. Here's my code:

<%@ Language = VBSCRIPT %>
<% Option Explicit %>

<!-- #include file="dbConn.asp" -->
<!--#include file="adovbs.inc"--> ...

View Replies View Related

Copy Binary Field

I use AspUpload to save files in a MSSQL database, orks just fine.Now I need to copy this binary from one table to another. DataType is image.

I found the answer:in MSSQL ntext, text and image datatypes of large values have to be handled by Transact-SQL fuctions handling data block by block.(the field itself has only a pointer to the data).

View Replies View Related

Saving Binary Data

Does anyone know a website with a guide on how to upload binary data to a MySQL database using ASP?I have a script that i spent a lot of hours on getting to work,but after i upgraded my MySQL server it doesn't work anymore

I'm just getting an error from the odbc driver(upgraded from 2.5X odbc driver to 3.51X):

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Invalid string or buffer length

I'm trying to do the upload via AspSmartUpload,with a script that opens the record and uses .AddNew to the recordset.

View Replies View Related

Uploading Binary Data

How is it possible to upload binary data (like images or MIDI files) to the server? the code to (if necessary) a password protected FTP account?

View Replies View Related

Send Binary To Email

I have a problem converting binary to text. I am reading a page using xmlhttp

xmlhttp.open "GET", url, false ,"userName","password"
xmlhttp.send ""
tex3 = xmlhttp.responseBody

now I have the binary data of the html page I am reading. I can write this data to the asp page using Response.BinaryWrite tex3. I need to convert it to ASCI. I have tried:

tex3 = BinaryToText( tex3)

but did not work.

View Replies View Related

Reading Binary Data In SQL

I am storing PDFs as Binary data in MS SQL but do not know how to open the PDF files in ASP. Seperately, how do I capture the filename when I do a multipart/form-data?

View Replies View Related

Read Binary Data

I write the code as follows. But I cannot print the binary data as meaningful data format. any idea?

Response.Buffer = True
Const adTypeBinary = 1
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary

response.binarywrite rs("abc")

View Replies View Related

String Or Binary Data

I am having the following error when submitting dynamic data to an SQL Server database:

String or binary data would be truncated. This is of course happening when longer datafields are being inserted. I've tried changing the data types in the database itself, but that does not solve the problem. Do I need to change the data type of the field before it is submitted to the database?

View Replies View Related

String Or Binary Data Would Be Truncated

i have the following update statment that this error is coming from i dont realy understand why it is thorwing the error up becuase when i was testing it i change the letter 'c' to and 'a' so not sure why it would need truncated. what does this error actual mean or what do i look for Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved