Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created March 16, 2012 21:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/2053028 to your computer and use it in GitHub Desktop.
Save roxlu/2053028 to your computer and use it in GitHub Desktop.
Curl FTP upload
//--------------------------------------------------------------
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");
}
}
}
#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