Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php wideimage error

    Hey everyone, i was hoping i could get some help here.
    Warning: imagejpeg(../images/1383687601_herre2.jpg): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/city_cykler/includes/lib/Mapper/JPEG.php on line 39

    Fatal error: Uncaught exception 'WideImage_UnknownErrorWhileMappingException' with message 'WideImage_Mapper_JPEG returned an invalid result while saving to ../images/1383687601_herre2.jpg' in /Applications/XAMPP/xamppfiles/htdocs/city_cykler/includes/lib/Image.php:164 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/city_cykler/admin/cykeladd.php(46): WideImage_Image->saveToFile('../images/13836...') #1 /Applications/XAMPP/xamppfiles/htdocs/city_cykler/admin/index.php(46): include('/Applications/X...') #2 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/city_cykler/includes/lib/Image.php on line 164

    And this is my code
    Code:
    include '../includes/lib/wideimage.php';
    $fil = $_FILES['uploadet_fil'];
    if ($fil['error'] == 0) {
    $fil_navn = time() . "_" . $fil['name'];
    $billede_mappe = "../images/";
    $wi_billede_fuld = wideimage::load($fil['tmp_name']);
    $wi_billede_fuld -> saveToFile($billede_mappe . $fil_navn);
    $wi_billede_thumb = $wi_billede_fuld -> resizeDown (90, 120);
    $wi_billede_thumb -> saveToFile($billede_mappe . 'thumb/' . $fil_navn);
    }		
    And then i insert the file name into the DB ofc.
    <form method="post" action="" enctype="multipart/form-data">
    
    <input type="file" name="uploadet_fil"><br />
    <br><input type="submit" name="submit_cykel" value="Indsæt cykel"/>
    	</form>
    I think that was all, and hope someone can help me
    - Thanks in advance

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    This is a custom exception created by whatever software you are using.
    Fortunately, the underlying cause is likely the error above it with the imagejpeg. You simply cannot save to that location; you must adjust the privileges on the save directory.
    Looks like that'll be here: /Applications/XAMPP/xamppfiles/htdocs/city_cykler/includes/lib/images, but I cannot be 100% sure that's where the stack trace is going, so I based it off of the warning instead.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •