Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal,
Estava eu desenvolvendo um sistema para upload de imagens quando derrepente deu este erro:
PHP Warning: copy(conhece.jpg) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in E:\home\jackjee\Web\EMPRESA\gerenciador\paginas\foto_construcao.php on line 51
ei aqui meu script, vamos vcer se alguém descobre o que está acontecendo:
etc...
$nome_foto = $auto.time();
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "fUSUARIOS")) {
$insertSQL = sprintf("INSERT INTO Foto_Construcao (Codigo, Foto) VALUES (%s, %s)",
GetSQLValueString($produto, "text"),
GetSQLValueString($nome_foto, "text"));
$nome_foto = $nome_foto.".jpg";
$nome_foto2 = $nome_foto;
$nome_foto3 = "G_".$nome_foto;
$nome_foto = "P_".$nome_foto;
copy($foto,$nome_foto2);
list($width,$height) = getimagesize($nome_foto2);
if($width > $height)
{$porcentagem = (100*206)/$width;}
else { $porcentagem = (100*316)/$height;}
$tamanho_x = ceil($width*($porcentagem/100));
$tamanho_y = ceil($height*($porcentagem/100));
$image_p = imagecreatetruecolor($tamanho_x,$tamanho_y);
$image = imagecreatefromjpeg($nome_foto2);
imagecopyresized($image_p,$image,0,0,0,0,$tamanho_x, $tamanho_y, $width, $height);
imagejpeg($image_p, $nome_foto3, 100 );
$tamanho_x = ceil($width*($porcentagem/300));
$tamanho_y = ceil($height*($porcentagem/300));
$image_p = imagecreatetruecolor($tamanho_x,$tamanho_y);
$image = imagecreatefromjpeg($nome_foto2);
imagecopyresized($image_p,$image,0,0,0,0,$tamanho_x, $tamanho_y, $width, $height);
imagejpeg($image_p,$nome_foto,80);
unlink($nome_foto2);etc...
aff ¬¬
Carregando comentários...