Xavi Xavi - 1 year ago 90
PHP Question

Error uploading file using dropbox graham (Laravel)

I've got a form and when I click submit and It calls the controller but this gives me an error:

  • Class 'GrahamCampbell\Dropbox\Facades\Dropbox\WriteMode' not found

Also I tried to create a Folder in my dropbox to check If there are some problem to call the class but It works.


namespace App\Http\Controllers;

use GrahamCampbell\Dropbox\Facades\Dropbox;

use Illuminate\Http\Request;

use App\Test;

class ArticulosController extends Controller

public function store(){

$file = fopen('path/test.pdf', 'rb');
$size = filesize('path/test.pdf');

Dropbox::uploadFile('test.pdf', Dropbox\WriteMode::add(), $file, $size);
Dropbox::createFolder('/example'); //This function works

return redirect ('/home');


Answer Source

In spite of I tried to call WriteMode class, for some reason the function doesn't call WriteMode correctly. So I finally use Dropbox Adapter and know it works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download