NameSilo

What is wrong with this.. It is driving me nuts.

Spaceship Spaceship
Watch

iNod

Eating PieVIP Member
Impact
66
Hello,

I am trying to upload a image to uploads directory

PHP
PHP:
    $att_path = "/home/user/public_html/directory/uploads/";
    $uniq = substr( md5(uniqid (rand())), 0, 10 );
	$ext = strtolower( substr($_FILES['thumbnail']['name'], -3));
	move_uploaded_file($_FILES['thumbnail']['tmp_name'], $att_path."/".$uniq.".".$ext);
    $thumbnail = $att_path."/".$uniq.".".$ext;
I removed my username and directory name due to security reasons.


HTML
Code:
<input name="thumbnail" type="file">

Maybe somebody else can find something wrong.

iNod
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Make sure your <form> tag has this:

enctype="multipart/form-data"

in it.
 
0
•••
Omg.. Thanks so much CompUXP.. I totally forgot about that

:)
 
0
•••
No problem... -_-
 
0
•••
lol, once i readed in a book, that is little line is easy to remember
enctype="multipart/form-data", but some times you can easily forget about it too,
now i really think that the author sure was right, and i'll be just making a note of that. :)
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back