ok
function immagineLoad($nome,$nome_imm,$path_big,$path_small,$max_size=0,$tumb_size=0) {
//copia il file nella cartella immagini originali
if (!move_uploaded_file($_FILES[$nome]['tmp_name'],$path_big.$nome_imm)) {
return FALSE;
} else {
if ($max_size > 0) {
//controllo dimensione massima immagine - beg
$dims = getimagesize($path_big.$nome_imm);
$im = imagecreatefromjpeg($path_big.$nome_imm);
if ($dims[0] > $max_size || $dims[1] > $max_size) {
$largo = $max_size;
$alto = $max_size;
$rappx = $dims[0] / $largo;
$rappy = $dims[1] / $alto;
if ( $rappx < $rappy ) {
$desty = $alto;
$destx = (int)($dims[0]/$rappy);
} else {
$desty = (int)($dims[1]/$rappx);
$destx = $largo;
}
$smallim = imagecreatetruecolor($destx,$desty);
imagecopyresampled($smallim,$im,0,0,0,0,$destx,$desty,$dims[0],$dims[1]);
imagejpeg($smallim,$path_big.$nome_imm);
}
}
chmod($path_big.$nome_imm,0777);
if ($tumb_size > 0) {
//creazione thumbnail - beg
$dims = getimagesize($path_big.$nome_imm);
$im = imagecreatefromjpeg($path_big.$nome_imm);
$largo = $tumb_size;
$alto = $tumb_size;
$rappx = $dims[0] / $largo;
$rappy = $dims[1] / $alto;
if ( $rappx < $rappy ) {
$desty = $alto;
$destx = (int)($dims[0]/$rappy);
} else {
$desty = (int)($dims[1]/$rappx);
$destx = $largo;
}
$smallim = imagecreatetruecolor($destx,$desty);
imagecopyresampled($smallim,$im,0,0,0,0,$destx,$desty,$dims[0],$dims[1]);
imagejpeg($smallim,$path_small.$nome_imm);
chmod($path_small.$nome_imm,0777);
//creazione thumbnail - end
}
return TRUE;
}
}
questa è la funzione per caricare l'immagine...nel file log del server mi da questomessaggio:
[client 217.133.143.227] PHP Warning: move_uploaded_file(http://www............/Tramonto.jpg): failed to open stream: HTTP wrapper does not support writeable connections. in /home/httpd/vhosts/jangacafe.com/httpdocs/common/functions.php on line 220, referer: http://www...............newsletter.php?action=nledit
[client 217.133.143.227] PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpOGJQJ7' to 'http://www................Tramonto.jpg' in /home/httpd/vhosts/.........../httpdocs/common/functions.php on line 220, referer: http://www................/private/newsletter.php?action=nledit
grazie