473,396 Members | 1,789 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,396 software developers and data experts.

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

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
Jul 19 '05 #1
1 4167
you to specify the enctype property of the form to
"multipart/formdata"

--
Roji. P. Thomas
SQL Server Programmer ;)
________________________
"ij" <ok> wrote in message
news:3f***********************@news.optusnet.com.a u...
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

Jul 19 '05 #2

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

Similar topics

3
by: Roberto | last post by:
I have the following problem: I have the following form client side: <FORM.......> <FORM action="./WZUpload.asp" method="Post" enctype="multipart/form-data" WIDTH=100%> <INPUT Type="file"...
0
by: ij | last post by:
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...
3
by: Kassam | last post by:
Hi MVPs out there. I have constructed an order form and the users will enter the informtion. I now need to send the filled out form as an e-mail (body being the HTML with the fille din data) to...
2
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
3
by: Simon | last post by:
Hi, I have webpage (sql.aspx) in asp.net with a big textbox. In this box, I generate SQL queries. Some of the queries can takes more than 2000 characters lenght. I want to send the content of the...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
2
by: Slim | last post by:
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...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.