forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: fade2grey on December 07, 2005, 04:26:59 pm

Title: The previous file could not be placed etc
Post by: fade2grey on December 07, 2005, 04:26:59 pm
Hi,

I've just joined, mainly because the coppermine install isn't going as swimmingly as I'd expected.

I'm running a local test system comprising:
W2k3 web
IIS6
PHP 5.1.1
MySQL 5.0.16 win16
GD2

I initially hit a problem creating albums but removing the requied field widget for description (which you cant populate in the GUI) resolved that one.. I wonder if that's caused knock on effects...

I currently have problems uploading pics.

the error I get is: The previous file could not be placed. You have successfully placed all the files. this is after I get the thumbnail screen & am able to fill in the description info etc & click continue.

I've checked the permissions on the Albums folder & they appear to be correct ( the IIS guest account having RWXD down the tree)

I can post the debug's on request ;)

Any suggestion of where to look - I've been trawling through the search results & google but find a lot of posts saying search for the error & you'll find the solution.. I haven't yet (& most are for CPG1.3..)

Cheers,
A
fade2greyuk [at] hotmail
Title: Re: The previous file could not be placed etc
Post by: kegobeer on December 08, 2005, 02:39:55 am
http://coppermine-gallery.net/tutorial/uploads/troubleshooting.php
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 08, 2005, 09:35:10 am
Hi KegObeer, thanks for the tutorial link, it's different from the version I'm using (1.4.2 stable apparently) but I've set the settings mentioned & sure enough it prevents some of the error masking... the full error is...

Error: There was an error while processing a database query
Code: [Select]
While executing query "INSERT INTO cpg140_pictures (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('', '2', 'userpics/', 'Image021.jpg', '36083', '60785', '640', '480', '1134030594', '1', 'Admin','', '', '', 'YES', '', '', '', '', '127.0.0.1', '127.0.0.1', '0')" on 0

mySQL error: Out of range value adjusted for column 'pid' at row 1

The table says it's auto generating the PID value so now I'm confused..

Any ideas? - I've already changed mySQL to Traditional from Strict & already had to change the album description field from required (since the gui doesnt let you populate it)

Anyone else has 'teething' problems like this installing on windows?

Cheers,
A
Title: Re: The previous file could not be placed etc
Post by: kegobeer on December 08, 2005, 02:57:21 pm
Are you positive you are actually not still in strict mode?  Did you follow the MySQL directions for switching away from strict mode?  Did you restart your server?
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 08, 2005, 03:09:06 pm
Yup, I'm sure it's running in "TRADITIONAL" it's currently set to: "TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Yup, I've restarted mySQL

I've just double checked it all & restarted it again & get the same error.

Looking at the PHP it's trying to insert an empty string into the PID field - which should be auto generated by the database - I have no idea if that ability has changed from mySQL versions prior to 5.1.1 though - any ideas?

Would be nice to know if anyone is running successfully with the same or similar config as myself & there's light at the end of the tunnel.

A
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 10, 2005, 05:02:01 pm
Hi everyone... any ideas?

Is this genuinely a code error & is it likely to be fixed any time soon? or is it worth either downgrading mysql to a pervious version (any other issues?) or finding another product?

A
Title: Re: The previous file could not be placed etc
Post by: Nibbler on December 10, 2005, 05:12:26 pm
Try modding the query. include/picmgmnt.inc.php

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('', '{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
   

to

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
   
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 10, 2005, 06:12:40 pm
Hi Nibbler,

Thanks for the quick reply, that's worked & got the picture in there.. :)

When I change the number of uploads back to more than one I still have the same problem where it says the files can't be placed - changing nothing else.

Hmm I'm guessing there's another similar reference in one of the other PHP scipts?

A
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 11, 2005, 07:38:55 pm
any suggestions of other scripts which need hacking & slashing to fix this one?
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 12, 2005, 04:29:51 pm
I notice that this thread is marked as solved, however just to clarify, it doesn't appear to be:

When the number of uploads is set to 1 - it works fine

When the number of uploads is set to more than 1 (eg 3) it doens't work resulting in the error:

The previous file could not be placed.

You have successfully placed all the files.


There's obviously something different happening in the multiple upload script which hasn't been resolved by the code change above. Suggestions?

Cheers all.
A
Title: problems with multiple uploads..
Post by: fade2grey on December 13, 2005, 12:04:54 pm
My other post is marked as solved so aren't expecting any more help on that thread..

http://forum.coppermine-gallery.net/index.php?topic=24764.0 (http://forum.coppermine-gallery.net/index.php?topic=24764.0)

Details of my setup & the problem are in the link above. Basically, with the code mod suggested it now works for single uploads but not for multiples - ie setting the number of upload boxes to more than 1. The process seems to work & then you get the files coulnd't be placed error.

Any more suggestions?

A
Title: Re: The previous file could not be placed etc
Post by: Joachim Müller on December 13, 2005, 06:10:58 pm
merged the new thread you started with the existing one you refered to. Nobody answered, because you still haven't done as suggested in the "upload troubleshooting" section of the docs (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#upload_trouble) that supporters have refered to before on this thread: you're meant to post a link and non-admin test user account with upload permissions, because we want to take a look at this for ourselves. If single uploads work OK for you, then set the upload method on the groups page to "2 files" instead of only one (differing slightly from the settings refered to in the trouble-shooting section).

Joachim
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 13, 2005, 06:45:46 pm
Hi GauGau

I've been through the troubleshooting mentioned by your colleagues.. (mentioned earlier in this thread).

Also I've confirmed that setting the uploads to 1 works, however setting the uploads to more than 1 results in the error stated.

I can't provide a link to the machine as it's an offline developement machine (Virtaul Machine).

Do you have any suggestions for other things I can look at or are we saying that it just plain don't work with the combination I've got loaded (also at the top of this post).

Cheers,
A
Title: Re: The previous file could not be placed etc
Post by: Joachim Müller on December 14, 2005, 07:55:33 am
not sure what to recommend then.
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 14, 2005, 08:53:31 am
Can anybody recommend an alternative? When looking at the options, did people just look at PHP solutions or did anyone evaluate any .net products? Any pointer before I hit google & start from scratch again?

Cheers,
A
Title: Re: The previous file could not be placed etc
Post by: Joachim Müller on December 14, 2005, 09:01:31 am
why don't you go for single uploads then? You (as admin) should use FTP-upload plus batch-add anyway instead of http uploads, so the single file upload method will apply only to your users. As you said that you're running your coppermine install on a virtual test server, the issue will probably go away anyway if you run it on a real webserver. I can't see a point in trying to fix something that appears to be a server-sided problem if you're never going to use that server in a production environment.
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 14, 2005, 10:25:21 am
The intention is for end users to upload potentially large numbers of files to this server ideally via the HTTP upload process, I'll test the XP upload functionality as a stop gap but it's not the way I'd like to go.

The server will remain a virtual one & it's my intention to consolodate a number of physical servers to one virtual host, which will include this server. There should be no issues running in a virtual machine using VMware (or Virtual Server these days).

When the single upload process runs, does it execute a different peice of code to the multiple upload? - it looks like the mod to stop trying to put a value in a field which the database should update resolved the issue but it potentially needs to be changed in another PHP script somewhere - I can't tell becasue the additional error masking on the multi upload prevents me from seeing the full error.

Any suggestions would be useful on where to look etc, I'm not a PHP guy but can find my way around most new stuff.

A
Title: Re: The previous file could not be placed etc
Post by: phase on December 15, 2005, 04:37:04 am
Has a solution for this problem been found yet? I am having the same issue and tried all the above suggestions and still getting the error.

thanks
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 15, 2005, 09:21:21 am
Hi Phase, no solution yet sadly..

can you give details of your setup just so we can tell if it's a problem with the 'widows' setup - using the latest & greatest or if it also affects other configs.

cheers,
A
Title: Re: The previous file could not be placed etc
Post by: elmo2274 on December 15, 2005, 03:28:19 pm
Just as a note to other users the query change earlier in this thread seemed to work for me (I don't think I changed anything else before testing again). My issue was not through the multiple file http upload but rather with only the batch add. My files were already up on the server and in the folder I wanted them in. Thanks! Good Luck fade2grey and Phase hope you get everything straightened out!
Title: Re: The previous file could not be placed etc
Post by: phase on December 16, 2005, 01:08:50 am
Thanks for the response.

My setup:
OS: linux
Apache: 1.3.34
php: 4.4.1
mysql: 4.0.25-standard

I will set up a test account tonight and post it back to the board. I have a 1.3.2 version that works just fine it only when I upgraded.

Thanks
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 16, 2005, 08:50:03 am
Thanks phase, looks like it's not down to something simple like versions of the components we are using.

Coppermine guys - any suggestions? Is this recognised as a bug/someone looking into it?

Cheers,
A
Title: Re: The previous file could not be placed etc
Post by: Joachim Müller on December 16, 2005, 10:07:21 am
@fade2grey: as suggested: it's impossible to tell, with your gallery not being available publicly. Imo it's a server setup issue. Coppermine hasn't been tested on virtual servers.

@all others: please do not reply to this thread - your issue may be different, even though the error message may be similar to the one fade2grey is getting. All replies to this thread that ask for support on similar issues will be split from the thread. Only the original poster fade2grey should reply to it, or people who have answers. Those who have questions should stay out of this thread and do as suggested in the upload troubleshooting section.
Title: Re: The previous file could not be placed etc
Post by: fade2grey on December 16, 2005, 10:48:37 am
@GauGau,  Ok I'll rebuild the server on a physical machine as soon as I have time - I'm 90% certain that it's not down to the virtualisation, something I've done a lot of in a number of environments. But, as you say, it's possible so I'll rule it out.

If you want, I can send you the Virtual Machine so you can run it yourself. Let me know your details\FTP details & we can do that.

Cheers,
A
Title: Re: The previous file could not be placed etc
Post by: plcdude on December 30, 2005, 07:38:42 am
Hi,
I had the exact same problem as you did on W2k3, mysql 5.xx etc.  >:(  I am new to mysql and php but not to programming.  I found that when doing a single upload, Coppermine creates a file in the "album" folder and then writes the data to it.  This requires the iuser to need the rights specified in the documentation.  However, when doing multiple http uploads Coppermine creates temp files in the "edit" folder, transfers the data and when it is through, renames the files (moving them to the "album" folder in the process).  To rename the file(s) the iuser needs "modify" rights also.  Set the modify rights for the albums folder and all sub folders and multiple uploads will work.  If you use frontpage to open the web that you are running Coppermine on, it may reset the modify right for the iuser on these folders which will break the upload function again!  At least it did on my server!  Now that I've got Copermine working correctly I am impressed with it.   :)
Title: Re: The previous file could not be placed etc
Post by: fade2grey on January 01, 2006, 12:32:55 am
plcdude - yup, I've just fettled the permissions on that folder & hey presto it all worky :) thanks for the PM, much appreciated.

@gaugau - just an FYI, it works fine in a Virtual machine.
Title: Re: The previous file could not be placed etc
Post by: plcdude on January 01, 2006, 04:06:05 am
The documentation does not say to set the "modify" permission.  See the FAQ at http://coppermine-gallery.net/tutorial/permissions/iis.php (http://coppermine-gallery.net/tutorial/permissions/iis.php).  I figured it out after looking through the code.  Since uploads worked in single file mode, I figured the code worked differently for multiple files (versus looping through the single file code xx number of times).  That is when I discovered that Coppermine renames the files in multiple mode.  Renaming requires the modify permission.
I totally agree with you on the destructions!  Maybe one of the Coppermine guys could update the documentation to include setting the modify permission.  It would make it much easier for others running Windows servers.  I came really close to dumping Coppermine until I figured out the problem.

 :)

cheers for that plcdude, I thought I'd applied the permissions from the 'albums' folder down over but obviously not :) ho hum...

It's all working tickey-boo now though which is good, I can finally get on with sticking stupid amounts of photo's online.

Would have been easier if ther destructions were a bit more specific for the windows side of CPG.

A