• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to check the exe file validation

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using strut2. And uploading the file.

I used the java script to avoid the exe file uploading.

But when i rename it.It get uploaded.

Can any tell me how to avoid exe file validation.

Thanks
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pankaj semwal wrote:But when i rename it.It get uploaded.


What do you mean?? Did you rename A.exe to B.exe or did you change the extension of the file??
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I rename the file.
from a.exe to a.doc.
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well since you changed the file name, javascript will definitely pass the file as being ok. If you want to check if a file is actually an exe file with a different extension, then you'll have to do something on the server side. You might need to check the first few bytes of the file (called the header) but I don't have any idea about exe file headers...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic