CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Other Programming Languages: PHP:
uploading an image

 



tolearn
Novice

May 1, 2006, 10:22 PM

Post #1 of 2 (31006 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


rork
User

May 3, 2006, 8:03 AM

Post #2 of 2 (31003 views)
Re: [tolearn] uploading an image [In reply to] Can't Post

Should be an error in your form (or filename). Make sure the file exists, it might have something to do with case-sensitivity or aliasses.
--
Don't reinvent the wheel, use it, abuse it or hack it.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives