Bonsoir,
J'ai un tout petit souci, j'utilise cette class http://icebeat.bitacoras.com/post/279/class-image .
Mais, il semblerait que je m'y prends mal ici :move_uploaded_file($thumb->Image($img_tmp),$chemin.$thumb->save())
Les images dans le dossier TMP ne veulent pas se déplacer.
Merci pour votre précieuse aide
require("class_resize.php");
//echo'<pre>';
//print_r($_FILES);
//echo'</pre>';
$chemin="imgs/"; //realpath(imgs);
foreach ($_FILES['file']['error'] as $key => $error) {
if ($_FILES['file']['error'][$key] > 0)
{
echo ' Code erreur: ' . $_FILES['file']['error'][$key] . '<br />';
}
else if (( ($_FILES['file']['type'][$key] == 'image/gif')
|| ($_FILES['file']['type'][$key] == 'image/jpeg')
|| ($_FILES['file']['type'][$key] == 'image/pjpeg')
|| ($_FILES['file']['type'][$key] == 'image/png'))
&& ($_FILES['file']['size'][$key] < 1000000))
{
echo 'Upload: ' . $_FILES['file']['name'][$key] . '<br>';
echo 'Type: ' . $_FILES['file']['type'][$key] . '<br />';
echo 'Size: ' . ($_FILES['file']['size'][$key] / 1024) . ' Kb<br>';
echo 'Temp file: ' . $_FILES['file']['tmp_name'][$key] . '<br>';
}
if (file_exists($chemin. $_FILES['file']['name'][$key]))
{
echo $_FILES['file']['name'][$key] . ' existe déjà !<br><br>';
}
else
{
$img_tmp=$_FILES['file']['tmp_name'][$key];
$unique = md5( uniqid() );
$thumb = new Image
($img_tmp);
$thumb->width(200);
$thumb->quality(50);;
$moveup=move_uploaded_file($thumb->Image($img_tmp),$chemin.$thumb->save());
if($moveup !=0)
{
// move_uploaded_file($_FILES['file']['tmp_name'][$key],
// $chemin . $_FILES['file']['name'][$key]);
echo 'Enregistrée en: ' . $chemin . $_FILES['file']['name'][$key].'<br><br>';
}
else
{
echo 'Fichier invalide !';
}}
}
Dernière modification par Diana (19-01-2011 20:05:03)