0

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.

<?php

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');
    }

}
Xavi
  • 25
  • 3

2 Answers2

0

I never worked with laravel dropbox. But the package that you are using doesn't contain the WriteMode class. The package does require the dropbox/dropbox-sdk package, and this does contain the WriteMode class (https://github.com/dropbox/dropbox-sdk-php/blob/master/lib/Dropbox/WriteMode.php).

So if you use Dropbox\WriteMode I think it will work.

Jan Wytze
  • 3,307
  • 5
  • 31
  • 51
  • How I should call this class? I tried but I can't. I had this file in project\vendor\dropbox\dropboxs-dk\lib\Dropbox. In addition, If I call this function from resources/layouts works well. – Xavi Feb 01 '17 at 14:15
0

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.

Xavi
  • 25
  • 3