Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/03/2010, 06:54
Avatar de b0zZy
b0zZy
 
Fecha de Ingreso: enero-2009
Ubicación: Francia
Mensajes: 28
Antigüedad: 15 años, 3 meses
Puntos: 0
De acuerdo Solucionado !! Ayuda a subir imagenes a localhost (wampserver)

Bueno pues parece que me habia equivocado en la function !! Me parece que es esta:
Código PHP:
function uploadProductImage($inputName$uploadDir)
{
    
$image     $_FILES[$inputName];
    
$uploadDir 'c:/wamp/www/plaincart/images/product/';
    
$imagePath '';
    
$thumbnailPath '';
    
    
// if a file is given
    
if (trim($image['tmp_name']) != '') {
        
$ext substr(strrchr($image['name'], "."), 1); //$extensions[$image['type']];

        // generate a random new file name to avoid name conflict
        
$imagePath md5(rand() * time()) . ".$ext";
        
        list(
$width$height$type$attr) = getimagesize($image['tmp_name']); 

        
// make sure the image width does not exceed the
        // maximum allowed width
        
if (LIMIT_PRODUCT_WIDTH && $width MAX_PRODUCT_IMAGE_WIDTH) {
            
$result    createThumbnail($image['tmp_name'], $uploadDir $imagePathMAX_PRODUCT_IMAGE_WIDTH);
            
$imagePath $result;
        } else {
            
$result move_uploaded_file($image['tmp_name'], $uploadDir $imagePath);
        }    
        
        if (
$result) {
            
// create thumbnail
            
$thumbnailPath =  md5(rand() * time()) . ".$ext";
            
$result createThumbnail($uploadDir $imagePath$uploadDir $thumbnailPathTHUMBNAIL_WIDTH);
            
            
// create thumbnail failed, delete the image
            
if (!$result) {
                
unlink($uploadDir $imagePath);
                
$imagePath $thumbnailPath '';
            } else {
                
$thumbnailPath $result;
            }    
        } else {
            
// the product cannot be upload / resized
            
$imagePath $thumbnailPath '';
        }
        
    }

    
    return array(
'image' => $imagePath'thumbnail' => $thumbnailPath);

Al menos despues de anadir:
$uploadDir = 'c:/wamp/www/plaincart/images/product/';, todo funciona !
No se como puedo poner el tema solucionado, pero lo esta !

Gracias de todas formas

Última edición por b0zZy; 13/03/2010 a las 06:58 Razón: Solucionado !!