Can't upload image at all

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Gigga

Can't upload image at all

Post by Gigga » Tue Oct 09, 2012 6:44 pm

I have this in HTML along with the registration info.

<form action="updatemem.php" method="POST" enctype=multipart/form-data">
<label for="image">Upload profile photo:</label>
<input type="file" name="image" />

In Updatemem.php:
$file = $_FILES['image']['tmp_name'];
if (!isset($file))
{echo "no file";
die;}

And when I choose a file, it goes into "no file". I echoed $file and it is blank. I've been looking all over the web and cant find any info. Please help!
Thanks!

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Can't upload image at all

Post by seandisanti » Wed Oct 10, 2012 9:34 am

you're missing a double quote on your enctype

Gigga

Re: Can't upload image at all

Post by Gigga » Wed Oct 10, 2012 2:25 pm

I compared it so much and I didn't see that. Thank you.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Can't upload image at all

Post by seandisanti » Wed Oct 10, 2012 3:03 pm

no problem, did that fix it?

gauravkachhadiya

Re: Can't upload image at all

Post by gauravkachhadiya » Thu Jun 19, 2014 3:10 am

please replace $file = $_FILES['image']['tmp_name']; to $file = $_FILES['image']['name']; and check it..

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests