|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I'm trying to implement a c++ client in linux that can upload and download files from a HTTP server. Downloading files seem to be easy, i only have to read the bytes that the HTTP GET command return in the socket, correct. For this mode (download) i only have one question, for binary files? this is done in another way or not? But to upload files i can seem to understand how this is done. I can't seem to understand if the HTTP command to be used is the PUT or POST but neither one do what i require (that is save a file in the server side). There is anyone that knows how this is done? what parameters are required for the correct HTTP command (PUT or POST)? Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <1177355630.993187.69240@b58g2000hsg.googlegroups. com>,
Nuno <nuno.esculcas@gmail.com> wrote: > Hello, > > I'm trying to implement a c++ client in linux that can upload and > download files from a HTTP server. > > > Downloading files seem to be easy, i only have to read the bytes that > the HTTP GET command return in the socket, correct. For this mode > (download) i only have one question, for binary files? > this is done in another way or not? > > > But to upload files i can seem to understand how this is done. I > can't > seem to understand if the HTTP command to be used is the PUT or POST > but neither one do what i require (that is save a file in the server > side). There is anyone that knows how this is done? what parameters > are required for the correct HTTP command (PUT or POST)? PUT is the command for uploading a file directly to a URL, but I suspect that most servers don't allow this. POST is for filling in a form, and the file contents will be the value of a form field that uses <INPUT TYPE=FILE NAME="filename">. See <http://www.cs.tut.fi/~jkorpela/forms/file.html> for information about uploading a file in a form. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
See RFC 1867.
|
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Apr 23, 12:13 pm, Nuno <nuno.escul...@gmail.com> wrote:
> But to upload files i can seem to understand how this is done. I > can't > seem to understand if the HTTP command to be used is the PUT or POST > but neither one do what i require (that is save a file in the server > side). There is anyone that knows how this is done? what parameters > are required for the correct HTTP command (PUT or POST)? There is no "one right way". Check the documentation for the particular web server you need to upload to. DS |
|
![]() |
| Outils de la discussion | |
|
|