Page 1 of 1

thumbnail creation: unable to open ... for writing ...

Posted: Tue Jan 30, 2007 11:29 pm
by potato
Hey,

im stucked for more than 6 hours! searching for a way to make some thumbnails of a uploaded image.
i tested 6 different thumnail classes from phpclasses.org, but i always get the same error like this one:

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://www.tuning-matrix.net/uploads/728803_596529.jpg' for writing in /home/tunixnet/public_html/core/functions/thumbnail/tnimg.lib.php on line 412

the tmp image and the folder where its in are chmod 777, so that not it.
I have checked in phpinfo that my gd is enabled, actualy all the options are enabled.
i'm using version: bundled (2.0.28 compatible)

somebody knows what it could be?

Thanx

Posted: Tue Jan 30, 2007 11:47 pm
by Kieran Huggins
try touch()ing the file first - it seems to work!

Posted: Tue Jan 30, 2007 11:58 pm
by potato
now i get this error:

Warning: touch() [function.touch]: Unable to create file http://www.tuning-matrix.net/uploads/728803_596531.jpg because No such file or directory in /home/tunixnet/public_html/core/functions/upload/uu_finished.php on line 204

but the image is there, chmodded 777, i think its a server issue

Posted: Wed Jan 31, 2007 12:10 am
by Kieran Huggins
wait a second... are you trying to touch/write to the file with the http:// prefix? You can't do that.. you need to access it as a local file.

Instead, try:

Code: Select all

touch('/home/tunixnet/public_html/uploads/728803_596531.jpg');

Posted: Wed Jan 31, 2007 12:23 am
by potato
jaaaaaaaa! :D THANKYOU!!

i had:

touch($path_to_upload.$uploaded_file_name);

but the strangest is that the url is correct, even when its not harcoded.
now i changed it to:

touch('/home/tunixnet/public_html/uploads/'.$uploaded_file_name.'');

again, the 2 urls are the same, but one works, another not, very strange.:?

You have an explanation for this?