This content has been marked as final. Show 4 replies
I cannot reproduce your scenario. When I attempt to upload a file of type .doc or .exe with the following code, I get the error message as expected. It reads
Only files of type "image/jpeg,image/jpg,image/pjpeg" can be uploaded.
Verify that you are uploading a file of the appropriate type.
The scenario is for example in your code it will accep .jpg, .jpeg and .pjpeg files, and what if I am uploading a .exe file (for example game.exe ) after renaming to .jpg ( game.jpg ) ? I will upload the file considering it as jpg. So I need to know any how we can prevent this by checking the file format etc.
When I rename app.exe to app.jpg and use the above code, I still get the same error message. Coldfusion can apparently tell the difference.
yes, CF does tell the difference between actual .jpg file and another
filetype renamed to .jpg extension since it looks at actual miime type
of the file, not just the extension of the file.
are you sure you are not looking at a real .jpg file that has been
uploaded to the servewr before? how does your cffile tag handle name