简体   繁体   中英

php saving file to a specific location

I am a bit of a dummy when it comes to php. I was wondering how to save a file uploaded to a php script (using POST) to a specific location. So for example i want to save it in the directory www.mysite.co.nz/data/motelname/

Also the android sends pairs of data, so how would i make that data into a file with the first bit of data the file name and the second the .txt file data.

If there are any tutorials on this please comment the here too thanks.

check out these:

http://www.htmlgoodies.com/beyond/php/article.php/3472551/PHP-Tutorial-Uploading-Files.htm

http://www.sitepoint.com/handle-file-uploads-php/

you can move the uploaded file to every folder that has 777-rights (do it with "chmod 777 foldername" on the shell) via

move_uploaded_file($tmp_name, "my_directory/$filename");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM