This code works properly in my localhost. I am using xampp 1.7.3. but when I put it in the live server it shows Possible file upload attack!
. \'upload/\' is the fol
You probably can't move your file to /upload/
which is an "upload" folder at the root of the server file system, hence move_uploaded_file()
reporting FALSE
and your message. Plus, this /upload/
folder probably doesn't even exist nor is it writeable.
You probably want to move it to $_SERVER['DOCUMENT_ROOT'].'/upload/'
which will point to your virtual host root (something like www or wherever you're uploading your application files). Don't forget to create this folder and to change its permissions accordingly (CHMOD 777 is a good idea).