Jump to content

Mindsparks

New Members
  • Posts

    3
  • Joined

  • Last visited

Mindsparks's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here's the rest of the statement(s) for a photo upload: if (isset($_FILES['photo_upload']) && ($_FILES['photo_upload']['size'] > 0)){ // try uploading photo if (isset($_REQUEST['photo_upload_imgname']) && $_REQUEST['photo_upload_imgname'] != ""){ // we already have it saved, so lets overwrite it $pic = new Picture($ABS_PATH, $_FILES['photo_upload'], $MAX_FILE_SIZE, $_REQUEST['photo_upload_imgname']); $_REQUEST['photo_url'] = $_REQUEST['photo_upload_imgname']; } else{ // create new file $pic = new Picture($ABS_PATH, $_FILES['photo_upload'], $MAX_FILE_SIZE); $_REQUEST['photo_url'] = $pic->generateRandFileName(13,"jpg"); } if (isset($PHOTO_WIDTH)){ $pic->resizeToWidth($PHOTO_WIDTH); } if (isset($PHOTO_HEIGHT)){ $pic->resizeToHeight($PHOTO_HEIGHT); } $pic->save(); $success = 0; if ($pic->isError() == false){ $success = 1; } else{ $msg .= "Error uploading photo: " .$pic->getErrorMessage() . "<br/>"; $_REQUEST['photo_url'] = ""; //clear since it failed } }
  2. Here's the backstory: I am helping someone transfer their website to a new hosting company. I recently uploaded all of the files from one host to another, which required me to also import the database. The website itself is running perfectly fine, except for one minor problem: the ability to upload files doesn't work anymore. The error I'm getting on the site itself is "Error Uploading Photo: Problem in Resizing". I didn't write the code myself and I'm not the best at debugging or writing PHP, I'm more of an HTML/CSS coder. The errors are coming from these lines: ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or $this->errmsg="Problem in resizing"; if (isset($_FILES['photo_upload']) && ($_FILES['photo_upload']['size'] > 0)){ . . . if ($pic->isError() == false){ $success = 1; } else{ $msg .= "Error uploading photo: " .$pic->getErrorMessage() . "<br/>"; $_REQUEST['photo_url'] = ""; //clear since it failed } } I'm trying to figure out how I should go about debugging this. I did a var_dump() of a few of the variables ($destimg, $srcimg): resource(7) of type (Unknown) bool(false) A colleague that I work with said to try resetting the permissions in the FTP for the folders to allow "Public Write" and that should fix it, but no success with that fix. As a side note, don't know if it's relevant, the "information_schema" database never imported via phpMyAdmin.
  3. I just tried creating an account here and I never received the validation email, therefore I was not able to post about the problem in the first place. I tried "Resend Validation", and changing my email in settings. I still didn't receive a validation email. I checked my spam folder, nothing. I emailed forums@phpfreaks.com, nothing. I tried connecting the existing account with Facebook, still couldn't post or validate. For a few days I was trying to figure out how to work around this problem. Eventually I just ended up making a new account and connected with Twitter instead. Just letting you know the problem exists, and I wonder how many users you are losing due to this problem. Besides all of that, I look forward to posting on here! Edit: That account, for reference, is Mindsparks. Thanks!
×
×
  • 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.