I’m building a WebApp that needs to send a text and a filename through AJAX to the PHP script(on the same place as the Javascript source of course) and the PHP script should save this file on the server, but how to make this?
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.
That sounds very simple actually. You just send your AJAX request:
And in PHP only need:
Obviously you need a bit more authorization, a pre-defined save
$dirand usingbasename()is only the minimum security precaution.