Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File (from form) not selected

Status
Not open for further replies.

jgd12345

Technical User
Joined
Apr 22, 2003
Messages
124
Location
GB
$upload_file = $HTTP_POST_FILES['flocation']['name']; echo $upload_file;
$temp = $HTTP_POST_FILES['flocation']['tmp_name'];
$extension = substr($upload_file, -4);

if($upload_file == "") {
// NO UPLOAD
} else {
// UPLOAD
}

Hi, I was wondering what's wrong with the above code (or if there's a better solution). I have a form with a field <input type=&quot;file&quot; name=&quot;flocation&quot;> and then the above carries out the form when it's submitted. I need to check if the user left it blank or not but I can't seem to get the above to work. I'd be greatful for your help. Thanx
 
does it echos the filename?

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top