| | | | |
| | |
| Gast
Beiträge: n/a
| Hallo. Ich habe mir ein Uploadscript runtergeladen,aber es funktioniert nicht.Nach dem Upload kommt: Log: Couldn't copy image 1 to server.Hier ist der PHP code.Ich hoffe ihr könnt mir auch sagen was falsch angegeben ist.Das Verzeichnis soll /Upload/ sein. Code: <? // Original script developed by the Zach White Network. // Modifications for flexible multi-uploads developed by // Greg Johnson // gjohnson@7south.com // 7 South Communications, Inc. // www.7south.com // Mod Date: 11-07-02 //user defined variables $abpath = "/Upload/"; //Absolute path to where images are uploaded. No trailing slash $sizelim = "no"; //Do you want size limit, yes or no $size = "1000000"; //What do you want size limited to be if there is one $number_of_uploads = 1; //Number of uploads to occur if ($_REQUEST['submitted']){ // Begin processing portion of script //all image types to upload $cert1 = "image/pjpeg"; //Jpeg type 1 $cert2 = "image/jpeg"; //Jpeg type 2 $cert3 = "image/gif"; //Gif type $cert4 = "image/ief"; //Ief type $cert5 = "image/png"; //Png type $cert6 = "image/tiff"; //Tiff type $cert7 = "image/bmp"; //Bmp Type $cert8 = "image/vnd.wap.wbmp"; //Wbmp type $cert9 = "image/x-cmu-raster"; //Ras type $cert10 = "image/x-x-portable-anymap"; //Pnm type $cert11 = "image/x-portable-bitmap"; //Pbm type $cert12 = "image/x-portable-graymap"; //Pgm type $cert13 = "image/x-portable-pixmap"; //Ppm type $cert14 = "image/x-rgb"; //Rgb type $cert15 = "image/x-xbitmap"; //Xbm type $cert16 = "image/x-xpixmap"; //Xpm type $cert17 = "image/x-xwindowdump"; //Xwd type $log = ""; for ($i=0; $i<$number_of_uploads; $i++) { //checks if file exists if ($img_name[$i] == "") { $log .= "No file selected for upload $i "; } if ($img_name[$i] != "") { //checks if file exists if (file_exists("$abpath/$img_name[$i]")) { $log .= "File $i already existed "; } else { //checks if files to big if (($sizelim == "yes") && ($img_size[$i] > $size)) { $log .= "File $i was too big "; } else { //Checks if file is an image if (($img_type[$i] == $cert1) or ($img_type[$i] == $cert2) or ($img_type[$i] == $cert3) or ($img_type[$i] == $cert4) or ($img_type[$i] == $cert5) or ($img_type[$i] == $cert6) or ($img_type[$i] == $cert7) or ($img_type[$i] == $cert8) or ($img_type[$i] == $cert9) or ($img_type[$i] == $cert10) or ($img_type[$i] == $cert11) or ($img_type[$i] == $cert12) or ($img_type[$i] == $cert13) or ($img_type[$i] == $cert14) or ($img_type[$i] == $cert15) or ($img_type[$i] == $cert16) or ($img_type[$i] == $cert17)) { @copy($img[$i], "$abpath/$img_name[$i]") or $log .= "Couldn't copy image 1 to server "; if (file_exists("$abpath/$img_name[$i]")) { $log .= "File $i was uploaded "; } } else { $log .= "File $i is not an image "; } } } } } ?> <html> <head> <title>Image Report</title> </head> <body> Log: <? echo "$log"; ?> </p> <body> </html> <? exit; } // End processing portion of script ?> <html> <head> <title>Upload Image</title> </head> <body> <form method=POST action=upload.php enctype=multipart/form-data> Files to upload: <? for ($j=0; $j<$number_of_uploads; $j++) { ?> <input type=file name=img[] size=30> <? } ?> <input type="hidden" name="submitted" value="true"> <input type="submit" name="submit" value="Upload"> </form> </body> </html> |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| uploadscript | SteiniKeule | Beitragsarchiv | 7 | 14.05.2008 23:12 |
| Neues Problem mit uploadscript | wiegia086 | PHP Tipps 2006 | 5 | 28.03.2006 10:21 |
| Brauche einige Tipps zu meinem Uploadscript | PHP Tipps 2006 | 8 | 11.03.2006 22:42 | |
| uploadscript - was ist da falsch? | imported_kremser | PHP Tipps 2006 | 9 | 13.02.2006 19:43 |
| Uploadscript - tmp_name immer leer trotz Auswahl | PHP Tipps 2005-2 | 5 | 25.10.2005 13:18 | |
| Simples Uploadscript.. | PHP Tipps 2005-2 | 14 | 09.09.2005 23:17 | |
| Uploadscript | PHP Tipps 2005-2 | 4 | 24.08.2005 21:15 | |
| Uploadscript | Beitragsarchiv | 2 | 05.07.2005 15:40 | |
| Uploadscript? | PHP Tipps 2005 | 2 | 10.04.2005 19:25 | |
| Intervallgesteuertes Uploadscript | PHP-Fortgeschrittene | 9 | 05.03.2005 19:19 | |
| Fehler beim Uploadscript | PHP Tipps 2005 | 3 | 05.03.2005 11:27 | |
| Uploadscript aber wie? | PHP Tipps 2005 | 1 | 13.02.2005 16:57 | |
| Problem mit Uploadscript | PHP Tipps 2004-2 | 3 | 17.12.2004 21:58 | |
| uploadscript | PHP Tipps 2004-2 | 0 | 09.12.2004 12:14 | |
| uploadscript mit unbestimmter anzahl von möglichen uploads | PHP Tipps 2004 | 2 | 26.08.2004 14:56 | |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| $abpath = $_server[\document_root\];, png geht nicht upload script, upload-script funktioniert nicht, upload file php geht nicht, $abpath = $_server[\document_root\], input file nicht leer php, uploaded.to upload mit root geht net, $cert17 = \image/x-xwindowdump\; //xwd type |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.