Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Photo submission problem (resolved)

Asked Modified Viewed 2,307 times
P
pourno
P
pourno 10
wafflechunks.com/../../images/banner2.gif
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
asked
Junior Member

I'm having problems with being able to have people submit .jpg or .jpeg photos. The dimensions and file size are both within the specified limits. I get the error:

Quote

Your Photo could not be submitted

Image must be a GIF, JPEG or PNG file.

Submit another Link


I checked out the submit.php file and it's got the .png, .jpg, .jpeg, and .gif file types in there. i haven't been able to try a .png file, but so far .gif is the only one that's working. Here's the snippet of code from my submit.php.

} elseif ($stype == "p") {
   if (isset($_POST['submit_photo'])) {
      require_once INCLUDES."photo_functions_include.php";
      $error = "";
      $submit_info['photo_title'] = stripinput($_POST['photo_title']);
      $submit_info['photo_description'] = stripinput($_POST['photo_description']);
      $submit_info['album_id'] = isNum($_POST['album_id']) ? $_POST['album_id'] : "0";
      if (is_uploaded_file($_FILES['photo_pic_file']['tmp_name'])) {
         $photo_types = array(".gif",".jpg",".jpeg",".png");
         $photo_pic = $_FILES['photo_pic_file'];
         $photo_name = strtolower(substr($photo_pic['name'], 0, strrpos($photo_pic['name'], ".")));
         $photo_ext = strtolower(strrchr($photo_pic['name'],"."));
         $photo_dest = PHOTOS."submissions/";
         if (!preg_match("/^[-0-9A-Z_\[\]]+$/i", $photo_name)) {
            $error = 1;
         } elseif ($photo_pic['size'] > $settings['photo_max_b']){
            $error = 2;
         } elseif (!in_array($photo_ext, $photo_types)) {
            $error = 3;
         } else {
            $photo_file = image_exists($photo_dest, $photo_name.$photo_ext);
            move_uploaded_file($photo_pic['tmp_name'], $photo_dest.$photo_file);
            chmod($photo_dest.$photo_file, 0644);
            $imagefile = @getimagesize($photo_dest.$photo_file);
            if (!verify_image($photo_dest.$photo_file)) {
               $error = 3;
               unlink($photo_dest.$photo_file);
            } elseif ($imagefile[0] > $settings['photo_max_w'] || $imagefile[1] > $settings['photo_max_h']) {
               $error = 4;
               unlink($photo_dest.$photo_file);
            } else {
               $submit_info['photo_file'] = $photo_file;
            }
         }
      }
      opentable($locale['570']);
      if (!$error) {
         $result = dbquery("INSERT INTO ".$db_prefix."submissions (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES ('p', '".$userdata['user_id']."', '".time()."', '".serialize($submit_info)."')");
         echo "<center><br>\n".$locale['580']."<br><br>
<a href='submit.php?stype=p'>".$locale['581']."</a><br><br>
<a href='index.php'>".$locale['412']."</a><br><br>\n</center>\n";
      } else {
         echo "<center><br>\n".$locale['600']."<br><br>\n";
         if ($error == 1) { echo $locale['601']; }
         elseif ($error == 2) { echo sprintf($locale['602'], $settings['photo_max_b']); }
         elseif ($error == 3) { echo $locale['603']; }
         elseif ($error == 4) { echo sprintf($locale['604'], $settings['photo_max_w'], $settings['photo_max_h']); }
         echo "<br><br>\n<a href='submit.php?stype=p'>".$locale['411']."</a><br><br>\n</center>\n";
      }
      closetable();
   } else {
      $opts = "";
      opentable($locale['570']);
      $result = dbquery("SELECT * FROM ".$db_prefix."photo_albums ORDER BY album_title");
      if (dbrows($result)) {
         while ($data = dbarray($result)) $opts .= "<option value='".$data['album_id']."'>".$data['album_title']."</option>\n";
         echo $locale['620']."<br><br>
<form name='submit_form' method='post' action='".FUSION_SELF."?stype=p' enctype='multipart/form-data' onSubmit='return validatePhoto(this);'>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='tbl'>".$locale['621']."</td>
<td class='tbl'><input type='text' name='photo_title' maxlength='100' class='textbox' style='width:250px;'></td>
</tr>
<tr>
<td valign='top' class='tbl'>".$locale['622']."</td>
<td class='tbl'><textarea name='photo_description' rows='5' class='textbox' style='width:250px;'></textarea></td>
</tr>
<tr>
<td valign='top' class='tbl'>".$locale['623']."</td>
<td class='tbl'><input type='file' name='photo_pic_file' class='textbox' style='width:250px;'><br>
<span class='small2'>".sprintf($locale['624'], parsebytesize($settings['photo_max_b']), $settings['photo_max_w'], $settings['photo_max_h'])."</span></td>
</tr>
<tr>
<td class='tbl'>".$locale['625']."</td>
<td class='tbl'><select name='album_id' class='textbox'>
$opts</select></td>
</tr>
<tr>
<td align='center' colspan='2' class='tbl'><br>
<input type='submit' name='submit_photo' value='".$locale['626']."' class='button'>
</td>
</tr>
</table>
</form>\n";
      } else {
         echo "<center><br>\n".$locale['551']."<br><br>\n</center>\n";
      }
      closetable();
   }
}
Edited by pourno on 11-05-2007 00:31,
0 replies

8 posts

W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Check your server GD settings in system admin, PHP info. Should look something like:

Quote

gd
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.10
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled


JPG support needs to be enabled on your server and you should set the GD version supported by your server in system admin, photo gallery settings, drop down box for thumb compression method.
0 replies
P
pourno
P
pourno 10
wafflechunks.com/../../images/banner2.gif
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

Here's my GD settings in PHP Info

Quote

GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
Edited by pourno on 07-05-2007 22:48,
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Check your settings in the admin section, both for GD and for allowed image size.

Also make sure that the image file names you test do not contain any odd characters or space.

You can download some of the images from the photo album from this site for testing.
0 replies
V
Voodoo-Publishing
V
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 2 threads in the forums
answered
Junior Member

I'm running into the same problems, but some jpg files work while others do not.. file size and GD settings are correct, and my php settings are all within spec as well..


Is there a way to upload directly to the gallery folders, and have Fusion pick them up from there? I've tried that as well, but there's no sign of them through the CP or Gallery links..

The only thing I haven't tried (yet) is converting them to another format.. i really don't want to do that..
0 replies
V
Voodoo-Publishing
V
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 2 threads in the forums
answered
Junior Member

never mind.. applying the v6.01.09 -> v6.01.10 patch to an earlier full install version of v6.01.10 did the trick.. that sounds confusing, huh..
Edited by Voodoo-Publishing on 08-05-2007 22:35,
0 replies
P
pourno
P
pourno 10
wafflechunks.com/../../images/banner2.gif
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

I'm using v6.01.10

System Admin>Photo Gallery Settings

Quote

Thumb size: 100x100
Photo size: 400x300
Max photo size: 1800x1600
Max file size(bytes): 2048000
Thumb compression: GD2 (I also tried GD1 and had no change)
Thumbs per row: 5
Thumbs per page: 20


I tested a couple different pictures from the php-fusion photo gallery and a .png file of my own and it gives me the same error message.

The largest image i've tried uploading is 1440x900 and none of them contain odd characters or spaces in the file names.

I have also tried re-uploading the original php-fusion files that have anything to do with submitting or the photo album and I still can't submit .jpg or .png files

Permissions of the following directories are set for 777
/images
/images/photoalbum
/images/photoalbum/submissions

I got absolutely no clue what is wrong. I know it worked before I upgraded both my site to I'm using v6.01.10 shortly after it was available, but I don't know if it has worked since then.

Edit:
I also noticed that when I view the contents of the photo albums I do not get thumbnails for the images. I also found out I can add .jpg and .png images to the album directly through Content Admin>Photo Albums>Album1
Edited by pourno on 08-05-2007 23:29,
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

It seems like there was a bug in the initial 6.01.10 update, so try like studio1031 suggested, to add the 6.01.9 --> 6.01.10 update from here:

http://www.php-fusion.co.uk/news.php?...admore=374
0 replies
P
pourno
P
pourno 10
wafflechunks.com/../../images/banner2.gif
  • Junior Member, joined since
  • Contributed 16 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

woot! fixed.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 3 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet