Hola, quiero subir un archivo desde mi computadora a mi cuenta de dropbox. pero cuando corro el archivo me sale este error:
Notice: Undefined index: /home in C:\xampp\htdocs\dropbox\index.php on line 33
Error: Remote directory must be a string, is NULL instead.
Según yo, ya declare la carpeta a la que quiero subir el archivo pero aún así me sigue marcando este error. ¿Alguien sabe por qué puede pasar esto?
Código PHP:
Ver original$uploader->upload($tmpFile, $_POST["home"]);
Y el código de la función es:
Código PHP:
Ver originalpublic function upload($filename, $remoteDir='/') {
throw new Exception("File '$filename' does not exist or is not readable.");
throw new Exception
("Remote directory must be a string, is ".gettype($remoteDir)." instead.");
if (!$this->loggedIn)
$this->login();
$data = $this->request('https://www.dropbox.com/home');
$token = $this->extractToken($data, 'https://dl-web.dropbox.com/upload');
$data = $this->request('https://dl-web.dropbox.com/upload', true, array('plain'=>'yes', 'file'=>'@'.$filename, 'dest'=>$remoteDir, 't'=>$token)); if (strpos($data, 'HTTP/1.1 302 FOUND') === false) throw new Exception('Upload failed!');
}