I've got a php form handler which takes data from an html page and creates and sends an email with one or more attachments.
I wanted to be smart and make sure a file had a size GREATER THAN 0. So I set
$attachment1_si ze = $_FILES['attachment1']['size'];
if ($attachment1_s ize > 0) {
And my 30KB file size comes up 0.
And the error codes showed no error.
When I took out the test for size and assumed (oh, bad) the file had a size >0, the file attached to the email perfectly.
My question is this: why, for a SMALL file, am I getting a 0 size?
The php config upload_max_file size is 2M. The MAX_FILE_SIZE on the html form is 1000000.
Any suggestions? I'd really like to test the file size.
I wanted to be smart and make sure a file had a size GREATER THAN 0. So I set
$attachment1_si ze = $_FILES['attachment1']['size'];
if ($attachment1_s ize > 0) {
And my 30KB file size comes up 0.
And the error codes showed no error.
When I took out the test for size and assumed (oh, bad) the file had a size >0, the file attached to the email perfectly.
My question is this: why, for a SMALL file, am I getting a 0 size?
The php config upload_max_file size is 2M. The MAX_FILE_SIZE on the html form is 1000000.
Any suggestions? I'd really like to test the file size.
Comment