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