forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: chkla on September 16, 2010, 01:24:44 pm

Title: replace picture plug-in
Post by: chkla on September 16, 2010, 01:24:44 pm
After upgrading to cpg 1.5.8. I did also an upgrade voor file replacer plug-in.
However it looks if it works, ( I see at least no error messages) but afterwards the file isn't replaced.
Title: Re: replace picture plug-in
Post by: Αndré on September 16, 2010, 02:40:38 pm
Clear your cache. The plugin works for me as expected.
Title: Re: replace picture plug-in
Post by: chkla on September 17, 2010, 01:16:43 pm
Sorry, but it still doesn't work.
I have even removed the plugin completely, downloaded anew and installed it again.
I have set debugging on. No error messages, but the picture isn't replaced.
Title: Re: replace picture plug-in
Post by: Αndré on September 17, 2010, 01:37:55 pm
Post a link to your gallery and a test account which is allowed to upload pictures and use the plugin.
Title: Re: replace picture plug-in
Post by: chkla on September 19, 2010, 02:19:15 pm
André I made a test account and an album:


http://nngfotoalbum.west-papua.nl/index.php?cat=10016
un: andre
pw: test!@#$

Category: Albums van leden
Album: andretest, with 5 pictures in it.

Title: Re: replace picture plug-in
Post by: chkla on September 30, 2010, 01:33:01 pm
I saw an upload, but nothing further.
No solutions?
Title: Re: replace picture plug-in
Post by: Αndré on September 30, 2010, 01:58:03 pm
I assume the error occurs here:
Code: (codebase.php) [Select]
move_uploaded_file($fileupload['tmp_name'], $image);
Please replace that line in codebase.php with the following code:
Code: [Select]
            if (!move_uploaded_file($fileupload['tmp_name'], $image)) {
                cpg_die(ERROR, 'There was an error moving the file \''.$fileupload['tmp_name'].'\' to its destination \''.$image.'\'', __FILE__, __LINE__);
            }
Title: Re: replace picture plug-in
Post by: chkla on October 01, 2010, 05:16:29 pm
I replaced the code and got the following error

Fout
There was an error moving the file 'C:WindowsTempphp8548.tmp' to its destination 'albums/userpics/10016/DSC07162.jpg'


I checked the rights on this map and changed it into full for all groups except for public users (windows).
However I still got the same errormessage.
Title: Re: replace picture plug-in
Post by: Αndré on October 01, 2010, 06:06:32 pm
Please have a look at the error message:
Quote
There was an error moving the file 'C:WindowsTempphp8548.tmp' to its destination 'albums/userpics/10016/DSC07162.jpg'

That path is invalid. I'll have a look at the code soon.
Title: Re: replace picture plug-in
Post by: chkla on November 18, 2010, 07:36:55 pm
Andre any news??
Title: Re: replace picture plug-in
Post by: Αndré on November 18, 2010, 08:11:52 pm
Sorry I lost sight of this topic. I just tested again on my Windows testbed running the Apache webserver. Works as expected. I currently don't know why it happens for you and am stuck. Maybe you can tell us a little bit more about your server setup?
Title: Re: replace picture plug-in
Post by: chkla on November 20, 2010, 07:29:14 am
Andre I can give you the following serverinformation:
windows 2008 SP2
windows firewall SP2
IIS7
PHP 4.4.7
MySQL 5.0.22 local

I tried to replace two pictures this morning:
the first one was in your album and originate in an userpic album. I tried to replace with a picture with a different name. Didn't work, so I thought maybe the rights are a problem
therefore I took another one in a dedicated album. Replace with a picture with exactly the same name didn't work either

I send you as an attachment a part of the logfiles. (It's a pity I can't upload in xls. Gives a better overview.)
Hope you can find something out.

Regards Chris
Title: Re: replace picture plug-in
Post by: Αndré on November 20, 2010, 08:49:03 am
As already said before, the cause is that all backslashes are stripped from your uploaded file path
Quote
C:WindowsTempphp8548.tmp

Please test if HTTP upload works for you in general. If you can, please also test if an upgrade to PHP5 fixes the issue. Also make sure none of Coppermine's files has been corrupted.
Title: Re: replace picture plug-in
Post by: Αndré on December 23, 2010, 03:50:56 pm
Please test version 1.6 of the plugin (http://forum.coppermine-gallery.net/index.php/topic,60499.0.html) and report if it works now.
Title: Re: replace picture plug-in
Post by: chkla on December 30, 2010, 08:32:02 am
André thanx. I installed version 1.6 and it works ok now.