PHP Contact Form filesize() [function.filesize] error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaiminrajani
Forum Newbie
Posts: 2
Joined: Fri Dec 11, 2009 10:26 pm

PHP Contact Form filesize() [function.filesize] error

Post by jaiminrajani »

I have a contact form in my website with the option to attach a file. I want to set the attachment limit as 10mb. But currently, after attaching a file to the contact form and clicking on 'submit', after the message is sent, the following error message is shown:

Warning: filesize() [function.filesize]: stat failed for 0 in /webcorp1/www/corpusers/j/a/jaimin.me/contact-form/contact-form/contact-form.php on line 127

The line 127 of my form is as follows:

filesize($_FILES[$i]['tmp_name']/1024) <= $x['maxsize'])

I would appreciate if anyone could help me out get rid of this error message and tell me how to set my attachment limit to 10mb.

Thank You.
Jaimin Rajani
Attachments
This is the error message above my form that is shown after a message is sent.
This is the error message above my form that is shown after a message is sent.
Untitled.jpg (61.58 KiB) Viewed 90 times
This is how the line 127 looks like.
This is how the line 127 looks like.
line 127.jpg (6.71 KiB) Viewed 90 times
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP Contact Form filesize() [function.filesize] error

Post by requinix »

Code: Select all

filesize($_FILES[$i]['tmp_name']/1024)
Think about that.
jaiminrajani
Forum Newbie
Posts: 2
Joined: Fri Dec 11, 2009 10:26 pm

Re: PHP Contact Form filesize() [function.filesize] error

Post by jaiminrajani »

^ Thank You for your reply. That's lot in fact, But my problem has been solved already in another forum ;)
Post Reply