Jump to content
Sign in to follow this  
SiteSniffer

[SCRIPTING] Upload a PNG

Recommended Posts

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?

Share this post


Link to post
Share on other sites

Never mind, found the problem.

	|| ($_FILES["file"]["type"] == "image/png")

should be:

	|| ($_FILES["file"]["type"] == "image/x-png")

Topic can be closed if needed.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...