Tutorial by Examples

<?php $path = 'test_php_upload.txt'; $fp = fopen($path, 'rb'); $size = filesize($path); $cheaders = array('Authorization: Bearer <ACCESS_TOKEN>', 'Content-Type: application/octet-stream', 'Dropbox-API-Arg: {"path":"/test/'.$path.'...
#include <stdio.h> #include <curl/curl.h> int main (int argc, char *argv[]) { CURL *curl; CURLcode res; /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_easy_init()...
This uploads a file from the local path matrices.txt in the current folder to /Homework/math/Matrices.txt in the Dropbox account, and returns the metadata for the uploaded file: echo "some content here" > matrices.txt curl -X POST https://content.dropboxapi.com/2/files/upload \ ...
This uses the SwiftyDropbox library to upload a file from a NSData to the Dropbox account, using upload sessions for larger files, handling every error case: import UIKit import SwiftyDropbox class ViewController: UIViewController { // replace this made up data with the real data le...
This example uses the Dropbox .NET library to upload a file to a Dropbox account, using upload sessions for larger files: private async Task Upload(string localPath, string remotePath) { const int ChunkSize = 4096 * 1024; using (var fileStream = File.Open(localPath, FileMode.Open)) ...
// ... file selected from a file <input> file = event.target.files[0]; $.ajax({ url: 'https://content.dropboxapi.com/2/files/upload', type: 'post', data: file, processData: false, contentType: 'application/octet-stream', headers: { "Authorization&q...
var data = new TextEncoder("utf-8").encode("Test"); $.ajax({ url: 'https://content.dropboxapi.com/2/files/upload', type: 'post', data: data, processData: false, contentType: 'application/octet-stream', headers: { "Authorization": ...
This uses the Dropbox Python SDK to upload a file to the Dropbox API from the local file as specified by file_path to the remote path as specified by dest_path. It also chooses whether or not to use an upload session based on the size of the file: f = open(file_path) file_size = os.path.getsize(fi...
var path = "/test_javascript_upload.txt"; var content = "data to upload"; var accessToken = "<ACCESS_TOKEN>"; var uploadUrl = "https://content.dropboxapi.com/2/files/upload" var result; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = fun...
This uses the SwiftyDropbox library to upload a file from a NSFileHandle to the Dropbox account using upload sessions, handling every error case: import UIKit import SwiftyDropbox class ViewController: UIViewController { // filled in later in doUpload: var fileHandle : NSFileHandle?...
This uses the Dropbox Objective-C SDK to upload a local file to Dropbox as "/test.txt". [[client.filesRoutes uploadUrl:@"/test.txt" inputUrl:[NSURL fileURLWithPath:@"/local/path/to/test.txt"]] response:^(DBFILESFileMetadata *metadata, DBFILESUploadError *uploadError, D...

Page 1 of 1