473,396 Members | 1,840 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.

HTTP Header form fields and file upload

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
4 4534
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Muttly | last post by:
Hey all. I'm trying to upload multiple files. I'm using the chm file from php.net to help me figure it out. I also checked online and say theres a problem with the file. Anyway My html looks like...
6
by: Mosher | last post by:
Hi all, this might be more of an html question but I think it can be done in PHP, so I will ask here. I have an html form that allows for .pdf file uploads. This script will serve two functions...
3
by: DiscoStu | last post by:
Hello Everyone, Is there any way to have the server specify exactly which file the form is to upload rather then letting the user browse their filesystem to select an arbitrary file? Thanks
0
by: Chris | last post by:
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...
0
by: Benjamin Bittner | last post by:
Hallo NG, ive searched a lot in some google groups, and found many threads, but nothing that helped me. Here is the scenario: I have an aspx page which loads a user control in page.onInit like...
0
by: Yandos | last post by:
Hello all, I'm sorry for a bit off-topic post, but curl does not have own newsgroup, so I hope someone might help me here... I need to feed form like the following using libcurl: <form...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
8
by: rn5a | last post by:
I came across this article titled Pure ASP File Upload at http://www.asp101.com/articles/jacob/scriptupload.asp & tried it on my local IIS5.1. Intranet server & it worked. I saved the necessary...
0
jhardman
by: jhardman | last post by:
Ever heard of this problem before? It's new to me. I'm just posting a link to this thread so discussion will stay in one place, originally posted in ASP forum, and it sounds like an ASP issue,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.