I have one public website where users have option to upload pdf file and read that pdf when they need.
I use php command
$error = copy($tmp_name, $fpath);
to save file to server....
the issue I am facing is
any one can upload any type (.exe, bat) of file but I only need pdf?
when try to browse pdf file, if some one change its (.exe, .bat) file extension to .pdf how to reduce risk of that script execute on server?
i am trying hard to solve this issue from last few days but no success...
Thanks