Can't upload image at all

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
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

Wed Oct 10, 2012 9:34 am

you're missing a double quote on your enctype

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

Wed Oct 10, 2012 3:03 pm

no problem, did that fix it?

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
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests