Re: Check the contents of a file field
| From: | shaun | Date: | Mon, 05 May 2003 22:44:17 +0000 |
| Subject: | Re: Check the contents of a file field | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146463@lists.php.net to get a copy of this message | ||
Thanks for your reply, but I am actually just trying to test whether the
field was left empty before submitting the form...
"Tom Woody" <woody@nfri.com> wrote in message
news:1052174076.18556.112.camel@vader.office.nfri.com...
> 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?
>