note 116393 added to features.file-upload.post-method

From: Date: Fri, 26 Dec 2014 11:44:47 +0000
Subject: note 116393 added to features.file-upload.post-method
Groups: php.notes 
Request: Send a blank email to php-notes+get-201256@lists.php.net to get a copy of this message
Some suggestions here: 1. It is always better to check for your error status. If MAX_FILE_SIZE is active and the uploaded file crossed the limit, it will set the error. So, only when error is zero (0), move the file. 2. If possible, never allow your script to upload in the path where file can be downloaded. Point your upload path to outside of public_html area or prevent direct browsing (using .htaccess restrictions). Think, if someone uploads malicious code, specially php codes, they will be executed on the server. 3. Do not use the file name sent by the client. Regenerate a new name for newly uploaded file. This prevents overwriting your old files. 4. Regularly track the disk space consumed, if you are running out of storage. ---- Server IP: 72.52.91.14 Probable Submitter: 217.165.61.135 ---- Manual Page -- http://php.net/manual/en/features.file-upload.post-method.php Edit -- https://master.php.net/note/edit/116393 Del: integrated -- https://master.php.net/note/delete/116393/integrated Del: useless -- https://master.php.net/note/delete/116393/useless Del: bad code -- https://master.php.net/note/delete/116393/bad+code Del: spam -- https://master.php.net/note/delete/116393/spam Del: non-english -- https://master.php.net/note/delete/116393/non-english Del: in docs -- https://master.php.net/note/delete/116393/in+docs Del: other reasons-- https://master.php.net/note/delete/116393 Reject -- https://master.php.net/note/reject/116393 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201256) next »