$_FILES['uploadedfile']
Moderator: General Moderators
$_FILES['uploadedfile']
Hi,
$_FILES['uploadedfile']
How can I check that the form field contains a file before the rest of the script exicutes?
Thanks
$_FILES['uploadedfile']
How can I check that the form field contains a file before the rest of the script exicutes?
Thanks
The answer is in the variable.
Run this script and you'll answer your own question.
Run this script and you'll answer your own question.
Code: Select all
echo '<HR><PRE>'; print_r($_FILES); echo '</PRE>';hawleyjr | Please use
But that just keeps taking me to the $back variable even when files have been added to the form
Thanks
hawleyjr | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have tried a few ways, ieCode: Select all
if ($_FILES['uploadedfile']['size'] > 0) {
echo "$back";
return;
}Thanks
hawleyjr | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Code: Select all
if (!$_FILES['uploadedfile']['error'])
{
#a file was uploaded
}