Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/03/2010, 16:01
Avatar de mayid
mayid
Colaborador
 
Fecha de Ingreso: marzo-2009
Ubicación: BsAs
Mensajes: 4.014
Antigüedad: 15 años, 2 meses
Puntos: 101
Respuesta: File not writable en PHP

Evidentemente el causante es esta linea.

$raiz = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'];

$raiz = ".." . $_GET['folder'];

Escrita de la primera manera, todo va bien en servidor local. Escrita de la otra, salta error.

El resto del codigo es este:
Código PHP:
if ($extension == "jpg" or $extension == "jpeg" or $extension == "gif" or $extension == "png" or $extension == "JPG" )
 {
// hago la miniatura
// ***********************************  //
require_once 'miniaturas/ThumbLib.inc.php';
        
// cambio el tamaño, poniendo maximos w & h
        
$options = array('jpegQuality' => 80);
        
        
$temporal $_FILES['Filedata']['tmp_name'];
        
$temporal urldecode($temporal);
        
        try
        {
             
$img PhpThumbFactory::create($temporal$options);
             
$thumb PhpThumbFactory::create($temporal$options);
        }
        catch (
Exception $e)
        {
             
// handle error here however you'd like
             
$error 'Error scaling the image.';
        }
        

// guarda la foto temporal        
// ***********************************  //
 
$img->resize(800,650)->save($raiz $nuevo_nombre);
 
$thumb->adaptiveResize(90,90)->save($raiz ."_thumb_".$nuevo_nombre);
}

elseif (
$extension == "aoi" or $extension == "zip" or $extension == "rar" or $extension == "g7"){
     
// manejo de errores
     
if (move_uploaded_file($_FILES['Filedata']['tmp_name'], $raiz.$nuevo_nombre)){
     }     else{
     
$error 'Error when saving the file!';
     }
};