CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 File mask doesn't stop wrong file types

Print topic Send  topic

Author Message
niwicp

Posts: 32
Posted: 09/11/2007, 4:13 AM

Hi,
I've a file upload control on my page and I set to allow just *.doc;*.txt so for example PDF files should not pass but it happens! I tested the page with both Internet Explorer 6 and FireFox and when I upload a test PDF files I get stopped with the correct message. But I checked on my server and found that about 10% of the files are PDF so it's not a couple of hackers having fun it must be something easy for the users. Any suggestion?
Thank you.

Nik
View profile  Send private message
klwillis


Posts: 428
Posted: 09/12/2007, 1:01 PM

What I do is check for the size of the file uploaded, if it's (0) then
an error either resulted because the file was too large, or the
filename was invalid (possibly blank, doesn't refer to any file, or bad extension).

I usually do this within th 'OnValidate' event for the FileUpload component.


Quote niwicp:
Hi,
I've a file upload control on my page and I set to allow just *.doc;*.txt so for example PDF files should not pass but it happens! I tested the page with both Internet Explorer 6 and FireFox and when I upload a test PDF files I get stopped with the correct message. But I checked on my server and found that about 10% of the files are PDF so it's not a couple of hackers having fun it must be something easy for the users. Any suggestion?
Thank you.

Nik

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.