perdido_e_sozinho Posted July 4, 2006 at 10:25 AM Report #36092 Posted July 4, 2006 at 10:25 AM Estou a desenvolver um site que tem como factor importante o desenvolvimento de um sistema de upload que imagens, que também faz uma redução da imagem. O que acontece é que quando uso o firefox o script funciona, e quando o faço em IE não funciona. Tenho definida a variavel oculta MAX_FILE_SIZE e o código fica aqui: // Adição de Imagem 1 if ( $_FILES['imagem1']['size'] == 0) { $imagem1 = ""; $imagem1tipo = ""; }else{ if ($_FILES['imagem1']['type'] == "image/jpg" or $_FILES['imagem1']['type'] == "image/jpeg"){ move_uploaded_file($_FILES['imagem1']['tmp_name'],"latest.img"); $im = imagecreatefromjpeg("latest.img"); $width = ImageSx($im); $height = ImageSy($im); $n_height = intval((350 * $height) / $width); $n_width = 350; $newimage = imagecreatetruecolor($n_width,$n_height); imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height); ImageJpeg($newimage,"latest.img"); $imagem1 = addslashes(fread(fopen("latest.img","rb"),filesize("latest.img"))); $imagem1tipo = "image/jpg"; } else { $_SESSION['erros'] = $_SESSION['erros'] + 'Imagem 1 - Tipo de imagem inválido. Apenas são permitidos ficheiros do tipo jpg. Imagem será ignorada.<br>'; $imagem1 = ""; $imagem1tipo = ""; } } Será que alguém terá uma pequena ideia do que possa ser?? Ando ás turras com isto à imenso tempo. Com os melhores cumprimentos, Sérgio Matias
Ped@ntilva Posted July 11, 2006 at 12:08 PM Report #37494 Posted July 11, 2006 at 12:08 PM Já experimentas-te por a funcionar o upload sem fazer a conversão da imagem?
skin Posted July 11, 2006 at 12:11 PM Report #37495 Posted July 11, 2006 at 12:11 PM eu também acho que o problema está a nível da conversão de imagem. è melhor fazeres como o Ped@ntilva disse, utilizares sistema de upload sem conversão de imagem. fica bem Our lives begin to end the day we become silent about things that matter - Martin Luther King
aparicio Posted July 11, 2006 at 12:39 PM Report #37501 Posted July 11, 2006 at 12:39 PM tenho um script em casa que o faz na perfeição! logo à noite coloco aqui!
Drone Posted July 11, 2006 at 12:59 PM Report #37509 Posted July 11, 2006 at 12:59 PM Qual é a mensagem de erro que te aparece!? eu nao estou a ver o porque isso estar a dar erro o codigo parece estar tudo bem.. ve la se tens o chmod da pasta a 777 exprimenta colocar echo $_POST['imagem1']; se isto fizer o output da directoria do ficheiro é porque o problema está no forumlario, ele ta a assumir o imagem1 como $_POST e nao como $_FILES ou seja ele nem seker executa esse codigo que tens ai 😉 eu nao sei porque isso acontece mas normalmente quando me acontece a mim eu costumo apagar o file field e por um novo com um nome diferente :S
aparicio Posted July 11, 2006 at 05:56 PM Report #37576 Posted July 11, 2006 at 05:56 PM amigos aqui têm o scrip a bombar: http://www.impliedbydesign.com/image-resize-wizard.html é livre! boa! agradeçam ao pessoal de lá!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now