Also http://www.marcel-ahrensfeld.de/upload/img ist der Order.
So, was habe ich oben gesagt, wo kommt der absolute Pfad hin?
Upload-System für Internetseiten
-
-
ich weiß die zeilen aber nicht an welche stelle an sie angibt. Schreib mir mal eben den kompletten code /img/ ist der andere, da das ding auf upload bei mir liegt.
-
Meinetwegen
PHP
Alles anzeigen<?php // ----------------------------------------- // Das Script kann unter Verwendung // dieses Vermerks uneingeschränkt // genutzt / verändert werden. // © [url]www.php-space.info[/url] // ----------------------------------------- @include_once('functions.php'); // ----------------------------------------- // Beispiel $path = '/bilder-upload-script/img/'; $path = './img/'; // Verzeichnis zum Speicher Ordner nach http://www.ihre-domain.de/ // Beispiel $img_path_up = '/home/www/web3/html/php-space/bilder-upload-script/img/'; $img_path_up = 'http://www.marcel-ahrensfeld.de/upload/img/'; // Absuluter Pfad zum Speicher Ordner $groessemax = 10000; // Maximal Datei Größe in KB (KiloByte) // ----------------------------------------- // Ab hier nichts mehr anpassen if (!isset($_GET["loechen"])) $_GET["loechen"] = ""; if (!isset($_GET["file"])) $_GET["file"] = ""; ?> <html> <head> <title>Datei Upload</title> <style type="text/css"> <!-- body, table{ color: #000; font: 11px Verdana, Tahoma, Arial, Helvetica, sans-serif; } div{ margin:0; padding:0; } --> </style> </head> <body> <? if(uploadmoeglichkeitpruefen()==false){ echo '<div style="color:red;">Es ist auf diesen Server kein Upload möglich, bitte wenden Sie sich an Ihren Hoster und bitten um Aktivierung der Php Upload Funktion.</div>'; exit; } if(file_exists($img_path_up)==false OR $img_path_up ==''){ echo '<div style="color:red;">Es gibt kein Ordner wohin die Bilder geladen werden sollen!</div>'; exit; } ?> [b]File Upload[/b] <? if($_POST["action"]){ $filename = ""; if ($HTTP_POST_FILES['userfile']['tmp_name']<> 'none'){ $file = $HTTP_POST_FILES['userfile']['name']; $temp = $HTTP_POST_FILES['userfile']['tmp_name']; $path_parts = pathinfo($file); $filename = "datei_" . time() . "." . $path_parts["extension"]; if($HTTP_POST_FILES['userfile']['size'] <= $groessemax*1024){ if(decoct(fileperms($img_path_up))==40777){ if(@copy($temp, $img_path_up.$filename)){ echo '<div style="color:green;">Datei ist auf den Server! '; echo 'Url der Datei: [url='http://'.$_SERVER['HTTP_HOST'].$path.$filename.'']http://'.$_SERVER['HTTP_HOST'].$path.$filename.'[/url] [url=''.$_SERVER['PHP_SELF'].'']Eine weitere Datei auf den Server laden...[/url] </div>'; } else { echo '<div style="color:red;">Die Datei konnte nicht auf den Server geladen werden. [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } else { echo '<div style="color:red;">Der Upload Ordner hat keine Schreibrechte! [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } else { echo '<div style="color:red;">Die Datei ist zu groß! Die Datei darf nicht größer als '.$groessemax.' KB (KiloByte) sein. [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } } else { ?> <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> die Datei darf nicht größer sein als <?php if((maximaledateiuploadgroesseermitteln()/1024)>$groessemax) echo $groessemax; else echo (maximaledateiuploadgroesseermitteln()/1024);?> KB (KiloByte). <input name="userfile" type="file" size="40"> <input type="submit" name="action" value="Speichern"> </form> <? } ?> [b]File List[/b] <? // Datein Löschen if($_GET["loechen"]==1 AND $_GET["file"]!=''){ if(file_exists($_GET["file"])==true){ if(@unlink($_GET["file"])==true) echo '<div style="color:green;">Die Datei wurde erfolgreich gelöscht! </div>'; else echo '<div style="color:red;">Die Datei konnte nicht gelöscht werden. </div>'; } else { echo '<div style="color:red;">Die Datei gibt es nicht im Upload Verzeichnis! </div>'; } } ?> <table border="0" bordercolor="Gray" bgcolor="DarkGray" cellspacing="2" cellpadding="2" width="500"> <tr align="middle" bgcolor="Gainsboro" style="font-weight:bold"> <td><SPAN class="fett">File</SPAN></td> <td><SPAN class="fett">Größe</SPAN></td> <td><SPAN class="fett">Letzte Änderung</SPAN></td> <td><SPAN class="fett">Aktion</SPAN></td> </tr> <? // Datein Verzeichnis ansgeben $i=0; $verz=opendir ($img_path_up); while (false !== ($file = readdir($verz))) { if (filetype($img_path_up.$file)!="dir"){ $i++; echo '<tr bgcolor="Gainsboro">'; echo ' <td>[url='http://'.$_SERVER['HTTP_HOST'].$path.$file.'']'.$file.'[/url]</td>'; echo ' <td>'.fs_convert($img_path_up.$file,2).'</td>'; echo ' <td>'.date("d.m.Y H:i", last_change($img_path_up.$file)).'</td>'; echo ' <td><a href="'.$_SERVER["PHP_SELF"].'?file='.$img_path_up.$file.'&loechen=1" >Löschen</td>'; echo '</tr>'; } } if($i==0){ echo '<tr bgcolor="Gainsboro">'; echo ' <td colspan="4">Es ist noch keine Datei im Upload Ordner.</td>'; echo '</tr>'; } closedir($verz); ?> </table> Programmierung: [url='http://www.php-space.info']www.php-space.info[/url]</P> </body> </html>
-
Das geht immer noch net : - ( http://www.marcel-ahrensfeld.de/upload/upload.php
-
PHP
Alles anzeigen<?php // ----------------------------------------- // Das Script kann unter Verwendung // dieses Vermerks uneingeschränkt // genutzt / verändert werden. // © [url]www.php-space.info[/url] // ----------------------------------------- @include_once('functions.php'); // ----------------------------------------- // Beispiel $path = '/bilder-upload-script/img/'; $path = './img/'; // Verzeichnis zum Speicher Ordner nach http://www.ihre-domain.de/ // Beispiel $img_path_up = '/home/www/web3/html/php-space/bilder-upload-script/img/'; $img_path_up = '/web/1/000/021/168/40853/htdocs/upload/img/'; // Absuluter Pfad zum Speicher Ordner $groessemax = 10000; // Maximal Datei Größe in KB (KiloByte) // ----------------------------------------- // Ab hier nichts mehr anpassen if (!isset($_GET["loechen"])) $_GET["loechen"] = ""; if (!isset($_GET["file"])) $_GET["file"] = ""; ?> <html> <head> <title>Datei Upload</title> <style type="text/css"> <!-- body, table{ color: #000; font: 11px Verdana, Tahoma, Arial, Helvetica, sans-serif; } div{ margin:0; padding:0; } --> </style> </head> <body> <? if(uploadmoeglichkeitpruefen()==false){ echo '<div style="color:red;">Es ist auf diesen Server kein Upload möglich, bitte wenden Sie sich an Ihren Hoster und bitten um Aktivierung der Php Upload Funktion.</div>'; exit; } if(file_exists($img_path_up)==false OR $img_path_up ==''){ echo '<div style="color:red;">Es gibt kein Ordner wohin die Bilder geladen werden sollen!</div>'; exit; } ?> [b]File Upload[/b] <? if($_POST["action"]){ $filename = ""; if ($HTTP_POST_FILES['userfile']['tmp_name']<> 'none'){ $file = $HTTP_POST_FILES['userfile']['name']; $temp = $HTTP_POST_FILES['userfile']['tmp_name']; $path_parts = pathinfo($file); $filename = "datei_" . time() . "." . $path_parts["extension"]; if($HTTP_POST_FILES['userfile']['size'] <= $groessemax*1024){ if(decoct(fileperms($img_path_up))==40777){ if(@copy($temp, $img_path_up.$filename)){ echo '<div style="color:green;">Datei ist auf den Server! '; echo 'Url der Datei: [url='http://'.$_SERVER['HTTP_HOST'].$path.$filename.'']http://'.$_SERVER['HTTP_HOST'].$path.$filename.'[/url] [url=''.$_SERVER['PHP_SELF'].'']Eine weitere Datei auf den Server laden...[/url] </div>'; } else { echo '<div style="color:red;">Die Datei konnte nicht auf den Server geladen werden. [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } else { echo '<div style="color:red;">Der Upload Ordner hat keine Schreibrechte! [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } else { echo '<div style="color:red;">Die Datei ist zu groß! Die Datei darf nicht größer als '.$groessemax.' KB (KiloByte) sein. [url=''.$_SERVER['PHP_SELF'].'']Noch mal versuchen...[/url] </div>'; } } } else { ?> <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> die Datei darf nicht größer sein als <?php if((maximaledateiuploadgroesseermitteln()/1024)>$groessemax) echo $groessemax; else echo (maximaledateiuploadgroesseermitteln()/1024);?> KB (KiloByte). <input name="userfile" type="file" size="40"> <input type="submit" name="action" value="Speichern"> </form> <? } ?> [b]File List[/b] <? // Datein Löschen if($_GET["loechen"]==1 AND $_GET["file"]!=''){ if(file_exists($_GET["file"])==true){ if(@unlink($_GET["file"])==true) echo '<div style="color:green;">Die Datei wurde erfolgreich gelöscht! </div>'; else echo '<div style="color:red;">Die Datei konnte nicht gelöscht werden. </div>'; } else { echo '<div style="color:red;">Die Datei gibt es nicht im Upload Verzeichnis! </div>'; } } ?> <table border="0" bordercolor="Gray" bgcolor="DarkGray" cellspacing="2" cellpadding="2" width="500"> <tr align="middle" bgcolor="Gainsboro" style="font-weight:bold"> <td><SPAN class="fett">File</SPAN></td> <td><SPAN class="fett">Größe</SPAN></td> <td><SPAN class="fett">Letzte Änderung</SPAN></td> <td><SPAN class="fett">Aktion</SPAN></td> </tr> <? // Datein Verzeichnis ansgeben $i=0; $verz=opendir ($img_path_up); while (false !== ($file = readdir($verz))) { if (filetype($img_path_up.$file)!="dir"){ $i++; echo '<tr bgcolor="Gainsboro">'; echo ' <td>[url='http://'.$_SERVER['HTTP_HOST'].$path.$file.'']'.$file.'[/url]</td>'; echo ' <td>'.fs_convert($img_path_up.$file,2).'</td>'; echo ' <td>'.date("d.m.Y H:i", last_change($img_path_up.$file)).'</td>'; echo ' <td><a href="'.$_SERVER["PHP_SELF"].'?file='.$img_path_up.$file.'&loechen=1" >Löschen</td>'; echo '</tr>'; } } if($i==0){ echo '<tr bgcolor="Gainsboro">'; echo ' <td colspan="4">Es ist noch keine Datei im Upload Ordner.</td>'; echo '</tr>'; } closedir($verz); ?> </table> Programmierung: [url='http://www.php-space.info']www.php-space.info[/url]</P> </body> </html>
-
Ich bekomm gleich einen Anfall *.* !!! Warum geht das net?
-
hast du den Code wie eben gepostet übernommen?
-
ja hab ich
-
Hast du allen Dateien und Ordner chmod 777 gegeben?
-
Habe ich es geht jedoch immer nocht nicht : - (((((((((((((((((((
-
Welche Version hast du eig gedownloadet??
-
1.0.1
-
Und was sagt 1.0?
-
wie?
-
Versuch Version 1.0
-
Bitte wieder richtig stellen:
PHP
Alles anzeigen<?php // ----------------------------------------- // Das Script kann unter Verwendung // dieses Vermerks uneingeschränkt // genutzt / verändert werden. // © [url]www.php-space.info[/url] // ----------------------------------------- $deindomain = "http://www.deindomain.de"; // Ihre Domain wo Sie das Script in geladen haben. $path = "/test/"; //Url zum Speicher Ordner ?> <html> <head> <title>Upload</title> </head> <body> <? if($action){ $filename = ""; $time=time(); if ($HTTP_POST_FILES['userfile']['tmp_name']<> 'none'){ $file = $HTTP_POST_FILES['userfile']['name']; $temp = $HTTP_POST_FILES['userfile']['tmp_name']; $path_parts = pathinfo($file); $filename = "test_" . $time . "." . $path_parts["extension"]; $dest = $path.$filename; copy($temp, $dest); echo 'Datei ist auf den Server!'; echo 'Url der Datei: '.$deindomain.$path.$filename; } } else { ?> <form method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>"> <input type="hidden" name="MAX_FILE_SIZE" value="400000"> [b]File Upload[/b] <input name="userfile" type="file" size=40> <input type="submit" name="action" value="Speichern"> </form> <? } ?> </body> </html>
-
[Siehe Unten]
-
PHP
Alles anzeigen<?php // ----------------------------------------- // Das Script kann unter Verwendung // dieses Vermerks uneingeschränkt // genutzt / verändert werden. // © [url]www.php-space.info[/url] // ----------------------------------------- $deindomain = "http://www.marcel-ahrensfeld.de"; // Ihre Domain wo Sie das Script in geladen haben. $path = "./upload/img/"; //Url zum Speicher Ordner ?> <html> <head> <title>Upload</title> </head> <body> <? if($action){ $filename = ""; $time=time(); if ($HTTP_POST_FILES['userfile']['tmp_name']<> 'none'){ $file = $HTTP_POST_FILES['userfile']['name']; $temp = $HTTP_POST_FILES['userfile']['tmp_name']; $path_parts = pathinfo($file); $filename = "test_" . $time . "." . $path_parts["extension"]; $dest = $path.$filename; copy($temp, $dest); echo 'Datei ist auf den Server!'; echo 'Url der Datei: '.$deindomain.$path.$filename; } } else { ?> <form method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>"> <input type="hidden" name="MAX_FILE_SIZE" value="400000"> [b]File Upload[/b] <input name="userfile" type="file" size=40> <input type="submit" name="action" value="Speichern"> </form> <? } ?> </body> </html>
-
ich glaub du hast was im script vergessen : - ) da uploadpfad
-
Geht net : - (
-