Notes for uploading files in php in linux ,. Notes for uploading files in php in linux. the example in this article shares the precautions for uploading files in php in linux for your reference, the specific content is as follows: 1. modify the upload directory permission linux notes for php file uploading in linux,
This article provides examples of considerations for uploading files in php in linux for your reference. the specific content is as follows:
1. modify the upload directory permission
Linux modifies all subdirectories in a directory
Chmod-R 777 html
Modify a directory to Grant write-read-write permission to any user.
Chmod a + rwx html
2. set the root directory of the uploaded file
// Obtain the Project root directory
$ SiteRoot = dirname (_ file __);
3. modify the configuration file upload size. php. ini
Post_max_size = 200 M
Upload_max_filesize = 200 M
4. if you want to create a folder based on the time and then upload the file, you need:
$aimUrl = str_replace('', '/', $aimUrl);$aimDir = '';$arr = explode('/', $aimUrl);foreach ($arr as $str) {$aimDir .= $str . '/';if (!file_exists($aimDir)) { mkdir($aimDir); chmod($aimDir, 0777); }}
The above is all the content of this article. I hope it will help you learn php programming.
Examples in this article share with you the notes for php file upload in linux for your reference. The details are as follows: 1. modify the upload directory permission for linux...