By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,625 Members | 2,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,625 IT Pros & Developers. It's quick & easy.

HTTP Header form fields and file upload

P: n/a
I'm trying to automate the process of uploading files from a client to
a webserver. I know that this can't be done by setting the value of
the file field in an html form.

So far, the plan is to mimic the upload form by sending an http
request to the server. I can do this without the file upload no
problem, but I can't figure out how to include the file as well. Can
anyone please help?

Chris
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 25 May 2004 13:15:59 -0700, c.******@ukonline.co.uk (Chris) wrote:
I'm trying to automate the process of uploading files from a client to
a webserver. I know that this can't be done by setting the value of
the file field in an html form.

So far, the plan is to mimic the upload form by sending an http
request to the server. I can do this without the file upload no
problem, but I can't figure out how to include the file as well. Can
anyone please help?


Can you clarify this a bit?

Are you essentially trying to create an HTTP request from some
non-browser software which will mimick what happens when a file is
uploaded from a browser form?

In this case, this isn't really the newsgroup for you, since you are
asking an HTTP question rather than an HTML question. (Someone here
can probably answer in suitable detail, though).

If instead you are asking if there's a way to automatically make a
browser upload a specific file without user intervention, then no that
is not possible for security reasons. (I think you said as much in
your first paragraph.)

If you are only interested in uploads from your non-browser client
software, you might instead prefer to bypass the usual form encoding
completely and just send a POST or PUT request with data of the
relevant type either included raw or using some kind of encoding. Just
set the Content-type to the correct type of the uploading data and
read the raw data on the server.

-Claire
Jul 20 '05 #2

P: n/a
Claire Tucker <fa**@invalid.com> wrote in message news:<9d********************************@4ax.com>. ..
On 25 May 2004 13:15:59 -0700, c.******@ukonline.co.uk (Chris) wrote:
I'm trying to automate the process of uploading files from a client to
a webserver. I know that this can't be done by setting the value of
the file field in an html form.

So far, the plan is to mimic the upload form by sending an http
request to the server. I can do this without the file upload no
problem, but I can't figure out how to include the file as well. Can
anyone please help?


Can you clarify this a bit?

Are you essentially trying to create an HTTP request from some
non-browser software which will mimick what happens when a file is
uploaded from a browser form?

In this case, this isn't really the newsgroup for you, since you are
asking an HTTP question rather than an HTML question. (Someone here
can probably answer in suitable detail, though).
[snip - sorry]
-Claire


Thanks Claire,

That's exactly what I'm after. I've tried IEWatch to 'sniff' the http
sent from a browser (mocked up the form in html) to the server inorder
to recreate it from a vb program, but it doesn't record enough detail.

Could you please point me to a suitable resource for creating the http
from scratch? I'm having very little luck I'm afraid.

Chris
Jul 20 '05 #3

P: n/a
"Chris" <c.******@ukonline.co.uk> a crit dans le message de
news:90**************************@posting.google.c om
I'm trying to automate the process of uploading files from a client to
a webserver. I know that this can't be done by setting the value of
the file field in an html form.

So far, the plan is to mimic the upload form by sending an http
request to the server. I can do this without the file upload no
problem, but I can't figure out how to include the file as well. Can
anyone please help?


You can read the HTTP RFC (2616), I think it contains all the informations
you need !

Jul 20 '05 #4

P: n/a
In article <90**************************@posting.google.com >,
c.******@ukonline.co.uk (Chris) writes:
Could you please point me to a suitable resource for creating the http
from scratch? I'm having very little luck I'm afraid.


The RFC is at ietf.org. Or can be found from the other usual suspects
such as w3.org. Either way, it's totally offtopic here.

If you want to do it the easy way, use a pre-packed implementation.
For example, it's a five-minute hack starting from Perl's LWP.

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.