|
-
May 2nd, 2006, 01:36 PM
#1
http upload to a tomcat server
Hi,
I' using the CIntrernetSession, CHttpFile classes & co. to download from a server (tomcat) a zipped file (like in TEAR example from MSDN). It works wonderfull. But:
HOW CAN I UPLOAD A ZIP FILE using the same http connection/session? I don't want to write to a directory (ftp). Please help, I don't understand how it works, but it must exist a solution for it too.
Thanks in advance,
Emil
-
May 2nd, 2006, 03:25 PM
#2
Re: http upload to a tomcat server
You need to study the PUT protocol for that in RFC 2068.
CHttpConnection supports that with HTTP_VERB_PUT so it should be able to do it with that, otherwise raw sockets would work too.
The headers need to come first particularly
Content-length and content-type.
Content-type: application/zip\r\n
Content-length: 'the length of your file'\r\n\r\n
then send your file at the length specified
-
May 2nd, 2006, 04:03 PM
#3
Re: http upload to a tomcat server
Take a look at WinInetPost . Study the sample code. It should help.
Gort...Klaatu, Barada Nikto!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|