Skip to content

Create OR Upload File

Kunal Varma edited this page Mar 11, 2016 · 2 revisions

Create File

Create a file with contents

$contents = "Hello World";
$item = $client->createFile("hello.txt", $contents);

Upload File

$file = "/path/to/file";
$createdFile = $client->uploadFile($file);

Upload file with a new name

$file = "helloworld.txt";
$createdFile = $client->uploadFile($file, "hello.txt");

Upload file to a folder

$file = "helloworld.txt";
$createdFile = $client->uploadFile($file, "hello.txt", $folderID);

Upload file from URL

$url = "http://example.com/hello-world.txt";
$createdFile = $client->uploadFromUrl($url, "hello.txt", $parentFolderID);

Table of Contents

Getting Started

Examples

Clone this wiki locally