php imagejpeg() Unable to open, No such file or directory or permission denied
<p>I get the following error when writing a thumbnail image to the below directory</p>

<pre><code>Warning: imagejpeg() [function.imagejpeg]: Unable to open 'D:\imagesdb\images\62t\' for    writing: No such file or directory
</code></pre>

<p>if I manually create a directory and then add that to imagejpeg() for example: C:\images I get the same error, this also applies if I use fopen</p>

<pre><code>Warning: fopen(C:\images\) [function.fopen]: failed to open stream: No such file or directory
</code></pre>

<p>All paths exsist! I have also checked the varibles to see if the paths are correct and I am not loosing data, (var_dump!)</p>

<p>I have also tried chmod, but I am using windows and this should not apply?</p>

<p>I am using </p>

<pre><code>Windows XP Home Edition SP3 running localhost, XAMMP, apache, php
</code></pre>

<p>I am worried if it the OS version I am using, I have tried giving the apache service
local system account access in 'services', tried sharing the folder!</p>

<p>I can write a normal images on upload to another folder 'images\62' in the same dirctory, however 'images\62t' either has permission denied, or does not exist when I try and write a thumb?</p>

<p>I have checked php.ini, gd is enabled and I have tried un-commenting: 
    extension=php_gd2.dll , safe-mode is also off.</p>

<p>I am worried if it is my OS version, it's very limited where file permissions are concerned?
Or is it just my code? </p>

<pre><code>if($this-&gt;changed){
    //$tp = fopen("C:\images\\",'w+');
    chmod($this-&gt;thumb_path, 0777);
    $originalImage = imagecreatefromjpeg($this-&gt;image_path);
    $width = imagesx($originalImage);
    $height = imagesy($originalImage);

    $thumb_width = $this-&gt;thumbWidth;
    $thumb_height = floor($height * ($this-&gt;thumbWidth / $width));
    $newImage = imagecreatetruecolor($thumb_width,$thumb_height);
    imagecopyresized($newImage,$originalImage, 0, 0, 0, 0, $thumb_width, $thumb_height,  $width, $height );
    imagejpeg($newImage,$this-&gt;thumb_path);

} else {
           $this-&gt;_messages[] = $field['name' ] . 'did not upload please check and try again' ;
}
</code></pre>
