C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 09-05-2009, 11:04 AM   #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.
s0nicstr1fe is offline   Reply With Quote
Old 09-05-2009, 12:43 PM   #2
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,242
why do you need a program?
write small batch file that uses ftp command to upload file

start this batch on scheduler...
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 09-06-2009, 06:09 AM   #3
Dae
Deprecated
 
Dae's Avatar
 
Join Date: Oct 2004
Location: Canada
Posts: 944
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.0 (lambda branch), Boost 1.40.0, Code::Blocks 8.02, Ubuntu 9.04 010001000110000101100101
Dae is offline   Reply With Quote
Old 09-06-2009, 09:52 AM   #4
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
I'd recommend checking out codeproject.com for C/C++ code.
I found some ftp uploading code there some time ago.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to program in unix Cpro Linux Programming 21 02-12-2008 10:54 AM
Simple FTP Upload in C (In backround) 108Stylez C Programming 5 10-31-2006 03:41 AM
How to fix misaligned assignment statements in the source code? biggyK C++ Programming 28 07-16-2006 11:35 PM
FTP Server :: Winsock kuphryn Windows Programming 2 10-03-2002 07:14 PM
FTP Upload Smoose777 C# Programming 1 08-13-2002 05:58 PM


All times are GMT -6. The time now is 09:07 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22