PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : PHP - prüfen, ob Bild hochgeladen wurde


Gast
2005-09-05, 11:33:32
if (isset($_FILES)) klappt nicht ...
Was kann ich stattdessen machen?

Gast
2005-09-05, 13:13:37
Wird die Datei im gleiches Script hoch geladen?

<?php
$uploadDir = '/var/www/uploads/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else
{
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>

Gast
2005-09-05, 13:16:02
http://www.netspade.com/articles/php/uploading.xml

Evalley
2005-09-05, 17:48:37
file_exists()