Jump to content

Recommended Posts

Hi. I have a form at http://www.renderforge.com/MainSite/OrderForm.htm

 

When visitors attempt to upload items they are send to a folder. The problem is that the form will accept most formats but NOT .jpg or .png. No problem with .jpeg, .gif.... etc.

 

Attached is the PHP code. Any help would really be appreciated.

 

 

 

[attachment deleted by admin]

if( $attachment_Mime_Type != "image/gif" AND $attachment_Mime_Type != "image/jpeg" AND $attachment_Mime_Type != "image/jpg" AND $attachment_Mime_Type != "image/png" AND $attachment_Mime_Type != "image/tiff" AND $attachment_Mime_Type != "text/plain" AND $attachment_Mime_Type != "text/rtf" )
{

that is bad, fat, and likely a pain to modify. No offense intended.

try this

$mimes = array( "image/gif", "image/jpeg", "image/jpg","image/png", "image/tiff","text/plain","text/rtf","image/bmp");
if(!in_array($attachment_Mime_Type, $mimes){ 

 

 

 

 

OK... I now feel like a complete jerk, as I should. I accept full responsibility for such an incredible piece of bad judgment.

 

Believe me, I try not to be a forum abuser. Just a really dumb mistake because the project got put on the back burner. I even did a search on the forums for a similar problem before I posted. Please accept my apologies everyone.

 

Slinking with tail between legs.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.