| | | | |
| | |
| Gast
Beiträge: n/a
| Hallo allerseits. Ich hab ein Upload-Script geschrieben, hab aber ein kleines Problem damit. Es funktioniert bei mir an meinem Pc, aber auf dem Webserver nicht. Hab schon geschat, Uploads sind Aktiviert. Fehler im Code ? Oder woran liegts ? Das Teil liegt im mom auf: http://www.dolphinworld.de/upload/upload.php Code: <html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript">
function change()
{
document.form.Uploadfile.value = document.form.file.value;
}
</script>
<body bgcolor="#FFFFFF" text="#000000">
<form name=form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="Uploadfile">
<input type="file" name="file" onChange="change()">
<input type="submit" value="hochladen">
</form>
<?
$NickName = "Jogi";
$maxfilesize = "50";
$uploadfile = $_POST['Uploadfile'];
$uploadfile = stripcslashes($uploadfile);
echo "Die Datei $uploadfile wird überprüft
";
$filesize = filesize($uploadfile);
$filesize = bcdiv($filesize,1028,0);
if ($filesize > $maxfilesize){
echo "Die Datei hat $filesize kb, maximal dürfen $maxfilesize kb geladen werden !
";
}
else
{
echo "Die Datei wird hochgeladen
";
################
# DATEI UPLOAD #
################
# Ermitteln des Dateityps
list($not_used, $filetype)=split('[.]',$uploadfile);
if ($filetype == "jpg") $filetypetest = 1;
if ($filetype == "gif") $filetypetest = 1;
if ($filetypetest != 1) {
echo "$filetype Es sind nur jpg und gif dateien erlaubt!";
}
else
{
$newfiletitle = "$NickName-avatar";
$newfilename = "$newfiletitle.$filetype";
#Alte Dateien löschen
if (file_exists("$newfiletitle.jpg")) unlink("$newfiletitle.jpg");
if (file_exists("$newfiletitle.gif")) unlink("$newfiletitle.gif");
$report = copy($uploadfile,$newfilename);
echo "Name der neuen Datei : $newfilename
";
if ($report == 1) echo "Upload erfolgreich";
if ($report != 1) echo "Fehler beim Upload";
################
# DATEI UPLOAD #
################
}
}
?>
</body>
</html>
|
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | ||
| Gast
Beiträge: n/a
| Zitat:
1. bool copy ( string source, string dest) 2. liefere einen Link auf ein phpinfo. | |
| | |
| Gast
Beiträge: n/a
| Hier ist mal die phpinfo http://www.dolphinworld.de/downloads/data/php.php Meist du das jetzt mit bool Copy ? Code: if (copy($uploadfile,$newfilename)){
....
....
|
| | |||
| Gast
Beiträge: n/a
| Zitat:
register_globals On Uff... Zitat:
Guck Dir mal das an (register_globals = Off): 11.11. Wie funktioniert ein Datei-Upload über HTML-Formulare? http://php-faq.info/index.php?aktion...id=127&lang=de ## EDIT Eben gefunden: Die Pfade für upload_tmp_dir und session.save_path sind etwas ungewöhnlich. Achte darauf, daß beide Pfade im open_basedir gelistet wind und daß beide Verzeichnisse die 0777 bekommen, damit der Apache auch reinschreiben darf. | ||
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Upload Script + Multible Server | cyberstorm | PHP Tipps 2006 | 5 | 11.10.2006 19:43 |
| upload system ... upload geht nicht ? | maTu | PHP Tipps 2006 | 3 | 25.03.2006 11:24 |
| Mediawiki: upload auch für zipdateien !? | Alpha Centauri | PHP-Fortgeschrittene | 6 | 20.01.2006 08:46 |
| [Erledigt] Automatische benachrichtigung an den Admin nach User Upload | PHP Tipps 2007 | 3 | 12.12.2005 21:25 | |
| Upload | Kevin | PHP Tipps 2005-2 | 5 | 13.10.2005 21:19 |
| FTP upload | PHP Tipps 2005-2 | 2 | 17.08.2005 11:43 | |
| Ansichtsproblem beim Upload | Off-Topic Diskussionen | 2 | 17.04.2005 21:11 | |
| ftp upload per get | Matthiasnet | PHP Tipps 2005 | 6 | 08.03.2005 19:30 |
| [Erledigt] "The directory you set for upload work cannot be reache | PHP Tipps 2005 | 5 | 07.02.2005 12:19 | |
| Was stimmt mit meinem Upload nicht? | Calli | PHP Tipps 2004-2 | 6 | 21.12.2004 12:54 |
| Ich bin auf der Suche nach einem fertigen Menü Upload Script | Beitragsarchiv | 7 | 22.08.2004 18:53 | |
| [Erledigt] Wie erstelle ich ein Upload Menü mit mehreren Menüpunkten ? | PHP Tipps 2004 | 3 | 22.08.2004 14:19 | |
| PHP Upload Dateigröße ermitteln? | PHP Tipps 2004 | 9 | 22.08.2004 13:48 | |
| [Erledigt] Php skript upload problem! | PHP Tipps 2004 | 2 | 30.06.2004 00:06 | |
| [Erledigt] File Upload: PRoblem mit Upload directory | PHP Tipps 2004 | 3 | 26.06.2004 13:20 | |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| php upload wann wird die filesize geprüft |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.