How to send a form with binary data to another server?

I

ij

Hi,

I'm trying to submit an image object, along with some other text fields to
another web server from within an ASP page but am stuck on getting the image
to be submitted with the form.

In a bit more detail:
1. When this particular page is executed, I want the server to pull an image
from a db (stored as a BLOB) along with a few other text fields. This part
is easy and I have no problems with it.
2. I want to submit the image, along with the text fields to a second
webserver which typically accepts its input from a form (ie, the second
webserver usually has a webpage where a user enters some information into
form and browse for a file. When clicking submit, the form fields along with
the file are submitted to the second server).

The reason for this is that I'm trying to migrate from one web based photo
album to another which uses a data structure that is complicated and
difficult to interface with, so I'm using the web based image upload
functionality of the new album.

Doing the above steps without the image / BLOB is fairly easy, and I have
successfully migrated the album info across using the code at the end of
this message.

The problem is doing the same but also submitting a BLOB.
I'm extremely stuck and any help would be very much appriciated.

Cheers,
Kent

Code:

strSQL = "SELECT Name, Description, Date, Owner_ID, id, category_id,
Parent_Album FROM photo_album WHERE ID =" + Request.QueryString("id") + ";"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.CommandTimeout = 120
objConn.ConnectionTimeout = 120
objConn.Open strConn
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.CursorLocation = 3
objRS.Open strSQL,objConn,2,2,1

if cint(objRS.fields("Parent_Album")) = 0 then
url = baseUrl & "cmd=new-album&protocol_version=2.1&set_albumName=" &
objRS.fields("category_id")
else
url = baseUrl & "cmd=new-album&protocol_version=2.1&set_albumName=" &
objRS.fields("Parent_Album")
end if
url = url & "&newAlbumName=" & objRS.fields("id")
url = url & "&newAlbumTitle=" & objRS.fields("Name")
url = url & "&newAlbumDesc=" & objRS.fields("date") &
objRS.fields("Description")
response.write(url)
response.write("<br><br>")

objXmlHttp.open "GET", url, False
objXmlHttp.send
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top