title: Warning: imagejpeg() [function.imagejpeg]: Unable to open [filename] for writing: No such file or directory
body: <p>I can't figure out why I'm receiving this error when trying to save an image using imagejpeg()</p>
  
  <p>Below is an excerpt from my code where I've eliminated anything extraneous and kept enough to generate the error. The path definitely exists and it has permissions set to 777.</p>
  
  <pre><code>$url = "http://website.com";
      $filename = 'imagename';
  
      $filepath = $url."/Images/accents/generated/".$filename.".jpg";
  
      $base = imagecreatefromjpeg($url.'/images/'.$filename);
      $imagewidth = imagesx($base);
      $imageheight = imagesy($base);
  
      $new = imagecreatetruecolor($imagewidth, $imageheight);
  
      imagecopy($new, $base, 0, 0, 0, 0, $imagewidth, $imageheight);
  
      imagejpeg($new, $filepath);
  
      imagedestroy($new);
  </code></pre>
  
  <p>`</p>