Developer Support »

Requiring at least one of two file upload fields but not necessarily both  (See more user questions)

Slight confusion. You want to check that the visitor has uploaded a file, I
was thinking they were entering something in a field or making a selection
from a drop-down list indicating that they were uploading a resume or
application and that you wanted to check that those fields weren't blank.

Use this line instead:

if(empty($_FILES['resume']['tmp_name']) &&
empty($_FILES['application']['tmp_name'])){$errors[] = "Please upload either
your resume or a completed application";}


Charles Sweeney
The world's easiest feedback script!

----- Original Message -----
Sent: Tuesday, February 08, 2011 8:59 PM
Subject: Re: New Feature?

Thanks for the speedy response (as usual!), but I didn't get it to work.

Here's the snippet of code where I placed it:

$errors = array();

if((isset($_POST['resume']) && empty($_POST['resume'])) && (isset($_POST['application']) && empty($_POST['application']))){$errors[] = "Please upload either your resume or a completed application";}

$attachment_array = array();

The form is here:

I tried submitting w/o attaching either and it went through to the thank you
page. I tried it on both FF & Safari (both for Mac).

Did I put it in the correct place?