Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
crio um insert e crio a pasta desta forma.:
@mkdir($diretorio.$pasta, 0777);
neste momento ela foi criada sem erros e inserida no banco de dados sem erro tb...
depois qdo eu subo uma imagem para esta pasta eu ainda dou outra permição.:
chmod($diretorio.$Rs->pastaImovel, 0777);
//e agora estou fando o upload com uma function q esta mais abaixo...
if (red_imagem($_FILES['multiFile']['tmp_name'][$i], $dir . $img, '1000', '1000', $dir . $img)){
$sql = "INSERT INTO imoveisimagens VALUES (NULL,'$id','".$img."')";
mysql_query($sql) or die
(
"<br /><p class='error'>Query com erro.:</p>".$sql."
<p class='error'>Dados técnicos.:</p>".mysql_error()
);
echo '<script type="text/javascript">
window.location = "?c=imoveis&r=InserirFotos&id='.$id.'"
</script>';
}
aqui está afuncção php do upload.:
function red_imagem($img, $imgName, $max_x, $max_y, $nome_foto) {
//pega o tamanho da imagem ($original_x, $original_y)
list($width, $height) = getimagesize($img);
$original_x = $width;
$original_y = $height;
$porcentagem = (100 * $max_x) / $original_x;
$tamanho_x = $original_x * ($porcentagem / 100);
$tamanho_y = $original_y * ($porcentagem / 100);
if(eregi(".jpg", $imgName)){
$image_p = imagecreatetruecolor($tamanho_x, $tamanho_y);
$image = imagecreatefromjpeg($img);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $tamanho_x, $tamanho_y, $width, $height);
return imagejpeg($image_p, $nome_foto, 30);
}else if(eregi(".gif", $imgName)){
$image_p = imagecreatetruecolor($tamanho_x, $tamanho_y);
$image = imagecreatefromgif($img);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $tamanho_x, $tamanho_y, $width, $height);
return imagegif($image_p, $nome_foto, 100);
}else if(eregi(".png", $imgName)){
$image_p = imagecreatetruecolor($tamanho_x, $tamanho_y);
$image = imagecreatefrompng($img);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $tamanho_x, $tamanho_y, $width, $height);
return imagepng($image_p, $nome_foto, 30);
}
}
bom eu não estou entendo o erro, pois eu jah uso ela um tempão e nunca deu erro
este é o erro.:
Warning: imagejpeg() [function.imagejpeg]: SAFE MODE Restriction in effect. The script whose uid is 10155 is not allowed to access /home/httpd/vhosts/qamais.com/httpdocs/laimoveis/@img/upload/fotosPropriedades/1310134021 owned by uid 48 in /home/httpd/vhosts/qamais.com/httpdocs/laimoveis/painelQA+/@regrasNegocios/funcoes.php on line 81
Warning: imagejpeg() [function.imagejpeg]: Invalid filename in /home/httpd/vhosts/qamais.com/httpdocs/laimoveis/painelQA+/@regrasNegocios/funcoes.php on line 81
ha so lembrando eu dei permição 777, no arquivo da função tb, mas num deu nada
Carregando comentários...