Welcome Guest, Not a member yet? Register   Sign In
Wrong file type for upload images
#1

[eluser]jaswinder_rana[/eluser]
Not sure if it's bug or just feature implementation.

I was testing an upload feature for uploading images. I created a text file and renamed it test.jpg.

I was able to upload it. Now, I understand that there is no way to know if a file is image or not until it's uploaded.

But, after uploading, the image checking function (which returns is_image) tells that it's an image. I am guessing that it does that by file type but that's not true. It should try to use those GD functions like imagecreate() and then return 1 or 0 depending on the output of this function.

I tried uploading that same file to imageshack.us. It did upload the file BUT after uploading, it did not display any image links. I think that's where they test if the uploaded file is image or not. They must delete (or quarntine) those files but that is (and should be) outside upload class and use dependant.


Thanks




Theme © iAndrew 2016 - Forum software by © MyBB