Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z wgraniem obrazka przez stronę
Forum PHP.pl > Forum > PHP
Artu123
Witam !


Zrobiłem upload grafiki w CMS'ie php-fusion i mam problem , przy wgraniu obrazka pokazuje mi się coś takiego :

Kod
Warning: move_uploaded_file(images/news/2009-06-18_200847.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/rxxxxxxx on line 80

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpW8Vx76' to 'images/news/2009-06-18_200847.jpg' in /home/xxxxxx on line 80

Warning: chmod() [function.chmod]: No such file or directory in /home/xxxxxx on line 81


80 i 81 linia to :

Kod
             move_uploaded_file($imgtemp, $afolder.$imgname);
             chmod($afolder.$imgname,0644);


Kod
     $zdjecie = false;
     if($_FILES['myfile'] != '') {
         $error = "";
         $image_types = array(
             ".gif",
             ".GIF",
             ".jpeg",
             ".JPEG",
             ".jpg",
             ".JPG",
             ".png",
             ".PNG"
         );
         $imgext = strrchr($_FILES['myfile']['name'], ".");
         $imgname = $_FILES['myfile']['name'];
         $imgsize = $_FILES['myfile']['size'];
         $imgtemp = $_FILES['myfile']['tmp_name'];
         if (!in_array($imgext, $image_types)) {
         } elseif (is_uploaded_file($imgtemp)){
             move_uploaded_file($imgtemp, $afolder.$imgname);
             chmod($afolder.$imgname,0644);
             $zdjecie = $imgname;
         }
     }


A to kod całego wgrywania obrazka 

Kod
echo "<form name='inputform' method='post' action='".FUSION_SELF.$aidlink."' enctype='multipart/form-data' onsubmit='return ValidateForm(this);'>\n";



 echo "<td class='tbl'><input type='file' name='myfile' class='textbox' style='width:250px;' /></td></tr>\n";

 echo "<input type='submit' name='save' value='".$locale['437']."' class='button' /></td>\n";

 echo "</tr>\n</table>\n</form>\n";




A tutaj wycięty kawałkami formularz . 
erix
Cytat
Unable to move '/tmp/phpW8Vx76' to 'images/news/2009-06-18_200847.jpg' in /home/xxxxxx on line 80

A to nie jest przypadkiem coś z serwerem namieszane? (vide: uprawnienia)
Artu123
Użyłem tego:

Kod
$afolder = IMAGES_N;


i działa smile.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.