473,800 Members | 3,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.QuerySt ring("id") + ";"
Set objConn = Server.CreateOb ject("ADODB.Con nection")
objConn.Command Timeout = 120
objConn.Connect ionTimeout = 120
objConn.Open strConn
Set objRS = Server.CreateOb ject("ADODB.Rec ordset")
objRS.CursorLoc ation = 3
objRS.Open strSQL,objConn, 2,2,1

if cint(objRS.fiel ds("Parent_Albu m")) = 0 then
url = baseUrl & "cmd=new-album&protocol_ version=2.1&set _albumName=" &
objRS.fields("c ategory_id")
else
url = baseUrl & "cmd=new-album&protocol_ version=2.1&set _albumName=" &
objRS.fields("P arent_Album")
end if
url = url & "&newAlbumName= " & objRS.fields("i d")
url = url & "&newAlbumTitle =" & objRS.fields("N ame")
url = url & "&newAlbumDesc= " & objRS.fields("d ate") &
objRS.fields("D escription")
response.write( url)
response.write( "<br><br>")

objXmlHttp.open "GET", url, False
objXmlHttp.send
Jul 19 '05 #1
1 4198
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.au...
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.QuerySt ring("id") + ";" Set objConn = Server.CreateOb ject("ADODB.Con nection")
objConn.Command Timeout = 120
objConn.Connect ionTimeout = 120
objConn.Open strConn
Set objRS = Server.CreateOb ject("ADODB.Rec ordset")
objRS.CursorLoc ation = 3
objRS.Open strSQL,objConn, 2,2,1

if cint(objRS.fiel ds("Parent_Albu m")) = 0 then
url = baseUrl & "cmd=new-album&protocol_ version=2.1&set _albumName=" &
objRS.fields("c ategory_id")
else
url = baseUrl & "cmd=new-album&protocol_ version=2.1&set _albumName=" &
objRS.fields("P arent_Album")
end if
url = url & "&newAlbumName= " & objRS.fields("i d")
url = url & "&newAlbumTitle =" & objRS.fields("N ame")
url = url & "&newAlbumDesc= " & objRS.fields("d ate") &
objRS.fields("D escription")
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
6191
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" name="UpFileName" STYLE="{Width:400px}"><BR>
0
715
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 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.
3
2207
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 a predefined e-mail address. I know how to use CDO. I don't want to go to another page to recontruct the HTML as the '.body' Thank you in anticipation. Kassam
2
2534
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 all records and sends each of them ONE BY ONE. After each record that my server script sends, it waits for the client to confirm proper reception with an ACK (binary digit). When there are no more records, my server script sends the client a binary
2
20751
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 But the problem occures when i want to send a data with & sign (i.e: Firm=F&B). I try to solve this problem with using boundary, but i failed. Any idea!?
3
2864
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 textbox (the query) in another webpage(result.aspx) textbox. I just don't know how. Can I use postmethod send ? can I use a public textbox object ? and how ? thank you, Simon
9
3167
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 other page, or is there something else like a stream which will be like a file. I am attempting to get a way from writing out a file and then having to give the page that I am posting to the file name. Instead I would like to just from asp.net...
2
2115
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 the binary data of the html page I am reading
1
3210
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 code for attachment, I am not able to send anything. I get blank email. Can you please help me on this? Here is the html form:
0
9695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9555
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10260
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10042
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.