Can i also use file_put_contents($fileapp,$content,FILE_BINARY); to move uploaded files?
Can i also use file_put_contents($fileapp,$content,FILE_BINARY); to move uploaded files?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can. But why not use
move_uploaded_file()instead? This is generally considered to be safer than trying to access the path in$_FILES, sincemove_uploaded_file()does check if the file really is a file and if it was actually uploaded by the user.If you can’t use the
move_uploaded_file(), remember to callis_uploaded_file()before you do thefile_put_contents()call. Just for your own safety.