note 57660 added to function.is-uploaded-file

From: Date: Mon, 10 Oct 2005 16:41:15 +0000
Subject: note 57660 added to function.is-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-96788@lists.php.net to get a copy of this message
Regarding topcat's suggested change, I am split on doing that. I don't like showing users errors that may give them more information than they should have (or show that I haven't provided for that particular error). But I want to know when there are errors that fall to the default case so I can fix my code. What I will typically do is write them to the error log something like this modification to metaltoad's post (takes into account the possibility of multi-line errors which error_log doesn't handle well): <?php default: //a default error, just in case! :) echo "There was a problem with your upload."; $err_msg = "Unrecognized file POST error: ".$HTTP_POST_FILES['userfile']['error']; if ((strpos($err_msg, "\n") === 0) { $err_lines = explode("\n", $err_msg); foreach ($err_lines as $msg) { error_log($msg, 0); } } else { error_log($err_msg, 0) } break; ?> ---- Manual Page -- http://www.php.net/manual/en/function.is-uploaded-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57660 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57660&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57660&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96788) next »