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

    uploading files to a website in c++

    Hi guys,

    I'm looking for a way to make a program upload a text file to my website.

    Is there some sort of function for that?

    Thanks in advance!

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: uploading files to a website in c++

    Usually files are uploaded by ftp, so you could make a ftp-client. But there are a lot of them so why build one.

  3. #3
    Join Date
    Sep 2007
    Posts
    117

    Re: uploading files to a website in c++

    Quote Originally Posted by Skizmo View Post
    Usually files are uploaded by ftp, so you could make a ftp-client. But there are a lot of them so why build one.
    Do you have any sample code for that please?

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: uploading files to a website in c++

    Try this.

  5. #5
    Join Date
    Sep 2007
    Posts
    117

    Re: uploading files to a website in c++

    Yes, naturally I've tried using google to find the answer.
    There's a lot of code out there, but I haven't been able to find anything that actually
    - allows uploading files to a website
    - works (without giving tons of errors or refers to .h or .lib files that are made available)

    So for that reason I thought I'd ask if anyone in the visual C++ community knew of sample code that doés work.

  6. #6
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: uploading files to a website in c++

    - allows uploading files to a website
    You don't upload files to a website, you upload files to a ftp server.

    - works (without giving tons of errors or refers to .h or .lib files that are made available)
    Ftp is a simple text command interface so you can send and receive files/info, nothing more.

    Here you go, a simple ftp class.

  7. #7
    Join Date
    Nov 2010
    Posts
    2

    Re: uploading files to a website in c++

    >You don't upload files to a website, you upload files to a ftp server.

    Not quite. If the web page supports input type="file", then you can use HTTP to upload files as well.

  8. #8
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: uploading files to a website in c++

    Quote Originally Posted by codalith View Post
    >You don't upload files to a website, you upload files to a ftp server.

    Not quite. If the web page supports input type="file", then you can use HTTP to upload files as well.
    Yes, but that is a html tag, so the page itself supports this. OP wants to do it from his C++ code.

  9. #9
    Join Date
    Nov 2010
    Posts
    2

    Re: uploading files to a website in c++

    If the web page supports that tag, then he can use httpwebrequest or similar to upload the text file to his website.

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