
tolearn
Novice
May 1, 2006, 10:22 PM
Post #1 of 2
(45994 views)
|
uploading an image
|
Can't Post
|
|
Hi, Im trying to upload an image using php.Im getting the file from a form and on submitting the form it calls a php file.Th file is <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/uploads/'; $uploadfile = $uploaddir . basename($HTTP_POST_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($HTTP_POST_FILES); print "</pre>"; ?> When i try to upload it raises a warinin message that the php file does not exists. Help me to sort out the problem
|