CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Posts
    66

    Angry 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

  2. #2
    Join Date
    Jul 2001
    Location
    Netherlands
    Posts
    751

    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

  3. #3
    Join Date
    Apr 1999
    Posts
    3,585

    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
  •  





Click Here to Expand Forum to Full Width

Featured