Jump to content

Image upload issues, help please


jumpenjuhosaphat

Recommended Posts

Okay, I am doing a script for a person in the UK, I am in the USA.  I am not having any troubles uploade .jpg's to the site, but she can't seem to do it without getting it caught in an error.  Here is the code that produces the error:
[code]    if($_FILES['adupload']['size']==0)
      {
      $error['adupload']="File is empty!";
      }
    if($_FILES['adupload']['type']!="image/jpeg")
      {
      $error['adupload']="Invalid image type, not a jpg";
      }[/code]

The error she is getting is "Invalid image type, not a jpg".  I had her send me the jpg in the email, and I uploaded it fine, but she still cannot.  What could be the reason for this?
Link to comment
https://forums.phpfreaks.com/topic/34889-image-upload-issues-help-please/
Share on other sites

I set up an account at http://www.fumbug.co.uk/login.php
Login details:
Username: phpfreak
Password: freak

If you could try to upload an image in jpg format that would be nice.  You would need to go to Create a New Ad in the menu on the left after signing in.
try this:

[code]
  if($_FILES['adupload']['size']==0)
      {
      $error['adupload']="File is empty!";
      }
    if($_FILES['adupload']['type']!="image/jpeg" || $_FILES['adupload']['type']!="image/pjpeg")
      {
      $error['adupload']="Invalid image type, not a jpg";
      }
[/code]
I got it fixed, the || should have been an && instead.  I don't know if there are still issues though, I haven't heard back from my person in the uk yet, if it's fixed, I'll be back to change this to solved, if not, I'll still be searching for solutions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.