Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/04/2013, 11:24
Avatar de gekkodb
gekkodb
 
Fecha de Ingreso: abril-2013
Ubicación: DF
Mensajes: 9
Antigüedad: 11 años
Puntos: 0
Respuesta: Problema con Uploader Dropbox

jeje, aquí está el código php que utiliza la parte de que contiene el formulario html para subir los archivos.

<?php
if ($_POST) {
require 'DropboxUploader.php';


try {
// Rename uploaded file to reflect original name
if ($_FILES['file']['error'] !== UPLOAD_ERR_OK)
throw new Exception('File was not successfully uploaded from your computer.');

$tmpDir = uniqid('/tmp/DropboxUploader-');
if (!mkdir($tmpDir)) //AQUI ME MARCA EL ERROR. line 21
throw new Exception('Cannot create temporary directory!');

if ($_FILES['file']['name'] === "")
throw new Exception('File name not supplied by the browser.');

$tmpFile = $tmpDir.'/'.str_replace("/\0", '_', $_FILES['file']['name']);
if (!move_uploaded_file($_FILES['file']['tmp_name'], $tmpFile))
throw new Exception('Cannot rename uploaded file!');

// Enter your Dropbox account credentials here
$uploader = new DropboxUploader('[email protected]', 'gekko.21');
$uploader->upload($tmpFile, $_POST['dest']);

echo '<span style="color: green;font-weight:bold;margin-left:393px;">File successfully uploaded to my Dropbox!</span>';
} catch(Exception $e) {
echo '<span style="color: red;font-weight:bold;margin-left:393px;">Error: ' . htmlspecialchars($e->getMessage()) . '</span>';
}

// Clean up
if (isset($tmpFile) && file_exists($tmpFile))
unlink($tmpFile);

if (isset($tmpDir) && file_exists($tmpDir))
rmdir($tmpDir);
}
?>


No sé si se puedan sjubir los archivos para que los vean.