note 41190 added to features.file-upload

From: Date: Fri, 02 Apr 2004 09:14:38 +0000
Subject: note 41190 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-67504@lists.php.net to get a copy of this message
When uploading files, it's good to check that a file does not exist on your server with the same name, or it will be overwritten. Here's my solution: $fileonserver = $pathonserver.$file_name; while (file_exists($fileonserver)) { $rand = rand(0, 9); $file_name = $rand.$file_name; $fileonserver = $pathonserver.$file_name; } ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41190 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41190&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41190&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67504) next »