Created
March 16, 2012 21:56
-
-
Save roxlu/2053028 to your computer and use it in GitHub Desktop.
Curl FTP upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ftp.setup("ftp.example.com", "username", "password", "HTML/"); // HTML/ <-- must end with slash. | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
ofSetWindowTitle(ofToString(ofGetFrameRate())); | |
ftp.update(); | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::keyPressed(int key){ | |
if(key == ' ') { | |
printf("add file.\n"); | |
if(!ftp.addFile(ofToDataPath("image.jpg", true))) { | |
printf("Cannot add handle"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
#include "Curl.h" | |
class testApp : public ofBaseApp{ | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
void keyPressed (int key); | |
void keyReleased(int key); | |
void mouseMoved(int x, int y ); | |
void mouseDragged(int x, int y, int button); | |
void mousePressed(int x, int y, int button); | |
void mouseReleased(int x, int y, int button); | |
void windowResized(int w, int h); | |
void dragEvent(ofDragInfo dragInfo); | |
void gotMessage(ofMessage msg); | |
roxlu::curl::FTP ftp; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment