Thread: HELP -Upload to Target FTP-

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    1

    HELP -Upload to Target FTP-

    Hello, I'm new to C++
    I have my basics down.

    I've been working on a project on my own to just start learning C++\C
    I have a simple program down to record error events from a video game I play and save them to a text file it saves.

    Now say I have an ftp, upload location, or twitter account.
    What type of source am I looking at for a secondary program to automatically upload changes made to my log? It'd have to run in the background so no one messes with it at home. =/ yeah I'm a game addict.

    Sorry if I'm a little vague, maybe thats why I'm not finding an answer to this. If anyone could point me in a good direction or maybe give me some example code to work on that be awesome.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    why do you need a program?
    write small batch file that uses ftp command to upload file

    start this batch on scheduler...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    He already has a program. He wants to create it for learning purposes.

    You need to send a series of HTTP commands (headers) to the designated website. You can use something like LiveHttpHeaders for Firefox to check which headers to send in order to upload a file (ie. GET something / POST something etc).

    I'd recommend a library (sort of) such as Asio (boost::asio), or libcurl. Most people just use the cURL program (via command-line arguments), or the cURL wrapper for PHP, but it starts out as a C library you can easily use from C++. All the PHP cURL information on Google is actually helpful since they use basically the same interface. There's plenty of cURL source code so you'll have it running in no time.

    It doesn't seem necessary, but it'll teach you a thing or two.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I'd recommend checking out codeproject.com for C/C++ code.
    I found some ftp uploading code there some time ago.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to program in unix
    By Cpro in forum Linux Programming
    Replies: 21
    Last Post: 02-12-2008, 10:54 AM
  2. Simple FTP Upload in C (In backround)
    By 108Stylez in forum C Programming
    Replies: 5
    Last Post: 10-31-2006, 03:41 AM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. FTP Server :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 10-03-2002, 07:14 PM
  5. FTP Upload
    By Smoose777 in forum C# Programming
    Replies: 1
    Last Post: 08-13-2002, 05:58 PM