SiteSniffer Posted October 1, 2010 Share Posted October 1, 2010 I can't seem to fin the error in this and I was hoping you all could take a quick peek at it. I'm making an upload script that makes you able to upload images to a server. Jpg and Gif work fine, PNG gets me an invalid. Here's the snippet: if (($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") && ($_FILES["file"]["size"] < 20000)) { I am 100% sure that the png files I tried to upload are valid png files (photoshop -> save for webdevices etc etc) so that's not it, the error is somewhere in the code (above) I think. Anyone got a clue what I'm doing wrong? Link to comment Share on other sites More sharing options...
SiteSniffer Posted October 1, 2010 Author Share Posted October 1, 2010 Never mind, found the problem. || ($_FILES["file"]["type"] == "image/png") should be: || ($_FILES["file"]["type"] == "image/x-png") Topic can be closed if needed. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.