Fog Creek Software
Discussion Board




Form post a file to a different server

Anyone ever post a file to a server outside your network using a form.  I have a feeling this is very simple but I haven't done it before and I am struggling.  We have a .pdf that is generated locally that must be posted to the client server via web form.  I am using classic ASP and VB6.  Any help, would be really appreciated.

Thanks

shiggins
Thursday, July 03, 2003

eh? from your web server or from the client?
just make sure the "action" param on the form is correct, and the client will do it. on the server, look at the serverxmlhttp object.

mb
Thursday, July 03, 2003

So I should just do something like:

<form method=post action=FormSave.asp enctype="multipart/form-data">
<input type=text name=strFile value="http:\\myServer\XMLTest\search.htm">
<input type=submit name=submit value="Submit">

And the client should be responsible for handling it?  I got the impression that I should also write the script to handle it to reside on the client server.

shiggins
Thursday, July 03, 2003

Actually
action=FormSave.asp should be
action=http://www.myClient.com/FormSave.asp

shiggins
Thursday, July 03, 2003

For the serverside Check out the code in the FileUpload servlet under Jakarta commons.

Adam Young
Thursday, July 03, 2003

Shiggins - I don't understand the scenario. You want a VB6 app to upload a file over HTTP? Or a web app? Or what?

Duncan Smart
Friday, July 04, 2003

If you want to browse for the file, do something like:

<form method="post" action="http://www.myserver.com/formsave.asp" enctype="multipart/form-data">
<input type="file" size="30">
<input type="submit" value="Upload">
</form>

pb
Monday, July 07, 2003

*  Recent Topics

*  Fog Creek Home