jaymc Posted December 28, 2006 Share Posted December 28, 2006 If I upload an image to my server with the following inside the file<a href=#>click here</a>It actually displays as a link when I go to www.site.com/image.jpgHow can I stop this, I own the server so i can amend what I like Quote Link to comment https://forums.phpfreaks.com/topic/32009-jpg-flaw/ Share on other sites More sharing options...
ToonMariner Posted December 28, 2006 Share Posted December 28, 2006 ????<a href=#>click here[/url] inside where?the link is dead btw - i get the 404 page Quote Link to comment https://forums.phpfreaks.com/topic/32009-jpg-flaw/#findComment-148574 Share on other sites More sharing options...
jaymc Posted December 28, 2006 Author Share Posted December 28, 2006 that link i put up was just an examplebasically if someone created a file on their desktop with the following as the contents of the file <a href=#>click hereAnd then saved that file as a .jpg file. if they then upload it to my site and try view the image, rather than it displaying an image error its parsing the HTML to screen Quote Link to comment https://forums.phpfreaks.com/topic/32009-jpg-flaw/#findComment-148597 Share on other sites More sharing options...
bljepp69 Posted December 28, 2006 Share Posted December 28, 2006 It's a browser issue. I just created a test file and looked at it in IE, and it behaved how you described. But FF simply displayed the name of the file as it didn't know what to do with it.You could do some error checking to make sure users are uploading only image files. Using getimagesize() is the best/quickest way to validate that it's an image. Quote Link to comment https://forums.phpfreaks.com/topic/32009-jpg-flaw/#findComment-148638 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.