Re: Check the contents of a file field
| From: | Tom Woody | Date: | Mon, 05 May 2003 22:34:36 +0000 |
| Subject: | Re: Check the contents of a file field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146462@lists.php.net to get a copy of this message | ||
A better way is this:
tmp_name will be empty if there was an upload problem...
if (is_uploaded_file($_FILES['FormFieldFile']['tmp_name'])) {
//successfully uploaded
//do action
}
else {
//something happened - do your error
}
On Mon, 2003-05-05 at 17:29, shaun wrote:
> Hi,
>
> I am trying to check whether the contents of a file field is empty but the
> following code doesnt work:
>
> if(isset($_POST[file]) == ''){
> $error = "Please select a document to add to the project";
> //etc
>
> could someone explain my error here please?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Tom Woody
Systems Manager, NationWide Flood Research, Inc.
phone: 214-631-0400 x209
In a world without boundaries why
do we need Gates and Windows?