<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[$_FILES vuoto genera errori]]></title><description><![CDATA[<p dir="auto">Salve a tutti,<br />
ho un semplice script che si occupa del caricamento di immagini su una cartella del server.<br />
[php]<br />
if (isset ($_FILES['new_image'])){<br />
$imagename = $_FILES['new_image']['name'];<br />
$source = $_FILES['new_image']['tmp_name'];<br />
$target = "<a href="http://www.giorgiotave.it/forum/images/" rel="nofollow ugc">http://www.giorgiotave.it/forum/images/</a>".$imagename;<br />
move_uploaded_file($source, $target);</p>
<pre><code>          $imagepath = $imagename;
            $pic1 =  $imagepath; 
          $save = "http://www.giorgiotave.it/forum/images/" . $imagepath; //This is the new file you saving
          $file = "http://www.giorgiotave.it/forum/images/" . $imagepath; //This is the original file

          list($width, $height) = getimagesize($file) ; 
                                                     
          $modwidth = 150; 
                                                     
          $diff = $width / $modwidth;
                                                    
          $modheight = $height / $diff; 
          $tn = imagecreatetruecolor($modwidth, $modheight) ; 
          $image = imagecreatefromjpeg($file) ; 
          imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; 
                                                    
          imagejpeg($tn, $save, 100) ; 

          $save = "http://www.giorgiotave.it/forum/images/sml_" . $imagepath; //This is the new file you saving
          $file = "http://www.giorgiotave.it/forum/images/" . $imagepath; //This is the original file
          list($width, $height) = getimagesize($file) ; 
                                              
      }        
</code></pre>
<p dir="auto">[/php]Se ho selezionato un immagine lo script non da problemi.<br />
Se invece non seleziono nessun file mi genera sta sfilza di errori</p>
<p dir="auto">Warning: Division by zero in</p>
<p dir="auto">Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in</p>
<p dir="auto">Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in</p>
<p dir="auto">Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'images/' is not a valid JPEG file in</p>
<p dir="auto">Warning: imagecopyresampled(): supplied argument is not a valid Image resource in</p>
<p dir="auto">Warning: imagejpeg(): supplied argument is not a valid Image resource in</p>
<p dir="auto">Teoricamente la clausola if (isset ($_FILES['new_image'])){ non dovrebbe bloccare l'esecuzione di tutte le istruzioni sottostanti? Perchè vengono eseguite comunque?</p>
<p dir="auto">Aiutatemi! E grazie in anticipo</p>
]]></description><link>https://connect.gt/topic/113818/_files-vuoto-genera-errori</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 07:00:21 GMT</lastBuildDate><atom:link href="https://connect.gt/topic/113818.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Oct 2009 08:55:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to $_FILES vuoto genera errori on Mon, 02 Nov 2009 07:04:56 GMT]]></title><description><![CDATA[<p dir="auto">Ii controlli su tipo di file, peso ecc saranno il secondo passo.<br />
Comunque ho risolto con un <em>is_file_uploaded</em>()</p>
]]></description><link>https://connect.gt/post/868485</link><guid isPermaLink="true">https://connect.gt/post/868485</guid><dc:creator><![CDATA[creepy.eyes]]></dc:creator><pubDate>Mon, 02 Nov 2009 07:04:56 GMT</pubDate></item><item><title><![CDATA[Reply to $_FILES vuoto genera errori on Fri, 30 Oct 2009 20:06:46 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Creepy-Eyes,</p>
<p dir="auto">dovresti inserire un controllo sul tipo di file, anche perchè se io passo un file che non è un immagine dovrebbe generare parecchi errori.</p>
]]></description><link>https://connect.gt/post/868415</link><guid isPermaLink="true">https://connect.gt/post/868415</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Fri, 30 Oct 2009 20:06:46 GMT</pubDate></item></channel></rss>