Hi guys.
I want to upload a file to ifile.it, an online sharing service (just like rapidshare.) They offer an api which i am trying to play with.
Okay the situation is that there are two steps involved in uploading a file to the server.
1) to find the server number i have done it successfully (by composing a correct http request-as given in the api).
2) 2nd step is given here http://ifile.it/misc?article=api_upload_single
The question is that I do not know how to find all the arguments needed in composing the correct http request.
I can get content length by size function.
I can make content-type: multipart/form-data (should it be form-data?) by writing as it is.
I do not know what boundary means???
I do not know how to get content-disposition; name etc...
So Please help me out.😕
By the way following is the example they have given: (if you do not want to visit a page)
[INDENT]POST /upload?apikey=<apikey>&response=text HTTP/1.1
Host: sX.ifile.it
User-Agent: MyClient 1.1
Content-Length: 778033
Content-Type: multipart/form-data; boundary=---------------------------114782935826962
-----------------------------114782935826962
Content-Disposition: form-data; name="Filedata"; filename="Penguins.jpg"
Content-Type: image/jpeg
...rest of request truncated due to excessive lenght,
basically the filedata is here, use wireshark with classic upload tool for an illustration...
[/INDENT]
The response tells you the link and some information about the file.
- the <apikey> is a key.
X in the HOST is the server id which is the first step.
* The file I want to store is on my web host and i am running this also on the web host. And there's no html involved. (I just want to read the file's information and be able to compose a good http request.)
Thanks you in advance 🙂