Document upload implementation(Mama, September 28, 2001) 17:14)PHP also supports the function of uploading files, but not all we

xiaoxiao2021-03-06  59

PHP also supports the function of uploading files, but not all websites that support PHP support this feature, especially free websites. Implement it uploaded, first join the "

" table of the upload file on HTML. When uploaded with PHP, you need to check the content, such as whether you allow reading and writing files, file format, and file size whether you specify in the size of you. $ file_size_max) {echo "Sorry, your file capacity is greater than the specified"; exit;} // check the read and write file IF (file_exists ($ store_dir. $ Upload_file_name) &&&&! $ Accept_overwrite {echo "File already exists, no replication"; exit;} // copy file to the specified directory IF (! @ Copy ($ upload_file, $ store_dir. $ Upload_file_name)) {Echo "copy file failed"; EXIT;} Echo "upload Documentation ";?> Need to note is that PHP is copied to the server temporary directory (TEMP) when the file is uploaded, and then use the PHP" Copy () "function to copy the file by the temporary directory to your specified storage. table of Contents. Since the program uses a temporary directory to work, if the server blocks the above features due to security issues, you cannot use the PHP upload function. In addition, the uploaded file directory also needs to set file mode 777 (ChMOD 777), otherwise PHP does not have to read and write files.

转载请注明原文地址:https://www.9cbs.com/read-113584.html

New Post(0)