Click to See Complete Forum and Search --> : uploading images to database
Squid
December 8th, 2004, 02:42 AM
$upload = $uploaddir . basename($_FILES['uploadedimage']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['uploadedimage']['tmp_name'], $upload))
{
echo "File is valid, and was successfully uploaded.\n";
}
The above codes work fine for PHP4 but seems like I am having trouble with it when I used PHP5. Anyone can help? Please?
visualAd
December 8th, 2004, 03:05 AM
Well, what is it thats not working?
Squid
December 8th, 2004, 04:13 AM
i cannot upload any files at all. even those small image files. why is that so?
visualAd
December 8th, 2004, 04:37 AM
There are many reasons why you they may not be uploading. Most likely you have not set the entype on the form in the HTML. But I will need to see more than just a couple of lines of code. The code you posted is valid but it will only work given a number of other criteria being satisfied.
blueday54555
December 8th, 2004, 11:09 AM
You say it worked fine with PHP4 but makes trouble with PHP5.
Do you have both installe don your PC ?
Or do you have php4 on your dev enviroment and php5 on the webserver ?
if php4 and 5 are on different machines check if you have permission
to upload any files !
check the php.ini if all settings are ok !
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.