Page 1 of 1

imagejpeg()

PostPosted: 23. August 2009 14:50
by rusik
Code: Select all
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://localhost/test/1/images/26.jpg' for writing: Invalid argument in C:\xampp\htdocs\test\1\check_image.php on line 91

On this line i have

Code: Select all
imagejpeg($image, $dir . '/' . $image_id  . '.jpg');


where,

Code: Select all
$dir ='http://localhost/test/1/images';

and $image_id is last sql query .
Why i can't use imagejpeg()? I can't create images in xampp directories(in test/1/images in my example)?How i can change permission on the folder to create images?

Re: imagejpeg()

PostPosted: 23. August 2009 15:04
by Wiedmann
Code: Select all
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://localhost/test/1/images/26.jpg' for writing:

Why i can't use imagejpeg()?

You can't write to a HTTP location. You can only write to a local filesystem location.

I can't create images in xampp directories

Why not?

Re: imagejpeg()

PostPosted: 23. August 2009 15:57
by rusik
Wiedmann wrote:
Code: Select all
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://localhost/test/1/images/26.jpg' for writing:

Why i can't use imagejpeg()?

You can't write to a HTTP location. You can only write to a local filesystem location.

I can't create images in xampp directories

Why not?

gg year thanks! u write C:/xampp/htdocs/test/1/images on $dir and it works!))
And how to change permission to http account?or xampp can't do this?))it is interesting...

Re: imagejpeg()

PostPosted: 23. August 2009 15:59
by Wiedmann
And how to change permission to http account?

Sorry, I#M not exaclty sure what you mean with this?

Re: imagejpeg()

PostPosted: 23. August 2009 17:16
by rusik
Wiedmann wrote:
And how to change permission to http account?

Sorry, I#M not exaclty sure what you mean with this?

I want create images in xampp directories)) you wrote i can't))

Re: imagejpeg()

PostPosted: 23. August 2009 17:25
by Wiedmann
you wrote i can't))

Regarding using a http location in imagejpeg() that's correct.
--> HTTP is a read-only protocol.