After i moved some files from directory #1 to directory #2, i can't download them via filedepot (Page not found).
I think the files are not moving physically on the server, but in the database the datas of the files updated.
In the filedepot.class.php (line 673, function moveFile()) there's a query:
...
$query2 = db_query("SELECT fname FROM {filedepot_fileversions} WHERE fid=%d", $fid);
while ($A = db_fetch_array($query2)) {
$vname = stripslashes($A['vname']);
...
The $A['vname'] should be $A['fname'], or not?
Comments
Comment #1
blainelang commentedThanks and that's one I should have found much sooner ;)
I have added more error checking as well as fixing the underlying code issue that you pointed out.
Attached is a patch that updates filedepot.class.php, ajaxserver.php and js/common.js
Comment #2
ldav1s commentedI applied the patch and created two folders, 'test' and 'test2'. I uploaded a file into 'test' and moved it to 'test2'. I'm not getting a download from either the file popup or the
download Action in the file list. I'm not sure why the file popup download is not working. The cid and fid look good. The download Action is obviously wrong (the cid is wrong, but the fid is right).
Comment #3
ldav1s commentedI'm not so sure about that obviously wrong part now. I tried uploading another file into 'test2' and it had the "wrong" cid, but downloaded OK.
Interestingly, the first file I had moved into 'test2' vanished after uploading the second file into 'test2'. It seems to be gone from the file store (filedepot_private), too.
So a recap:
-- created folders 'test' and 'test2' at the top level
-- uploaded 'file1' into 'test'
-- moved 'file1' into 'test2'. It looks OK, but attempting to download the file gives me nothing (via dialog) or an Access Denied (403) via the Action.
-- uploaded 'file2' into 'test2'. The only file in 'test2's listing is now 'file2'. 'file1' is gone from filedepot_private, but is in the file listing for 'test'.
If you attempt to download 'file1' you get a Page not Found.
Additionally download seems broken from the file dialog after the patch. Non-moved files still download OK from the Action link.
Comment #4
ldav1s commentedI figured out what needs to happen additionally.
-- created folders 'test' and 'test2' at the top level
-- uploaded 'file1' into 'test'
So far so good.
-- moved 'file1' into 'test2'.
'file1' is there OK. What is not there is filedepot_private/<cid>/.htaccess. This file seems to get created when a file is uploaded to a folder.
I thought that this would fix the download problem, but it didn't.
Comment #5
ldav1s commentedI got the Download/Edit actions downloading with this combined patch. I kept getting 'File record not found' messages in the log from filedepot_download/<cid>/<fid>.
I'm still seeing these problems:
-- created folders 'test' and 'test2' at the top level
-- uploaded 'file1' into 'test'
-- moved 'file1' into 'test2'. It looks OK, but attempting to download the file gives me nothing (via dialog), but Downloads Action seems OK, and downloads a file for Edit Action.
-- uploaded 'file2' into 'test2'. The only file in 'test2's listing is now 'file2'. 'file1' is gone from filedepot_private.
Comment #6
blainelang commentedI was just finishing up a patch that fixes the issue with the move and download broke after the move. Needed to update the drupal files table. I've also added another layer of testing to verify the file was moved.
Just having an issue creating these patches -- as my development environment is windows and I use PhpED as my ID.
Here is the patch for filedepot.class.php
Comment #7
ldav1s commentedI unapplied my patch in comment #5, and applied the patch in comment #6. It's having the same issues in the short test described in comment #5.
Comment #8
blainelang commentedI suspect there is an issue in how my patches are being created as I am able to upload files and still download them them after the move to another folder - using the download action, download menu item or via the native drupal view content interface.
Attached is a zip file with the two changed files. If this works then I will just commit to CVS.
Comment #9
ldav1s commentedI copied ajaxserver.php and filedepot.class.php to the filedepot directory (there didn't seem to be any difference between these files and the patched versions, other than CRLF/LF differences).
I am able to download through the native drupal view content interface, the download action, but not the download menu item.
Comment #10
ldav1s commentedSorry, I was wrong. I keep clicking on the "direct link to file" instead of the "Download link". Works.
Comment #11
blainelang commentedThanks -- you had me questioning if I needed stronger coffee.
@@
<
\/
Comment #12
artam commentedI applied the patches on my site (i downloaded the zip file).
I uploaded a file (via the client) with another user(name), who has admin rights on filedepot (I'm the superuser/uid=1).
I (as superuser) moved the file into folder#1 from the incoming view (it works fine). After that i'm tried to move the file form folder#1 to folder#2. "Activity" message appears for a long time, but nothing else.
I think, the problem is in the filedepot.class.php (line 658, function moveFile), there's a function called "fm_getPermission", but it doesn't exist (imho).
I changed the "fm_getPermission" function to the "$this->checkPermission" method, and it seems ok (i think so).
Comment #13
ldav1s commentedI've run into problems with fm_getPermission also, when I was trying a patch to move multiple directories. I made a similar patch IIRC. I don't know if it was correct, but at least it was better than "not defined".
Comment #14
blainelang commentedThanks --- will get this in the next CVS update.
Comment #15
blainelang commentedComment #16
ldav1s commentedFixed in 1.0-rc3.
Comment #18
david1982 commentedHi,
I have moved my Drupal Site from one server to another.
Before, base settings for Filedepot was:
C:/xampp/htdocs/filedepot_private/
Now, in new server it is D:/Documents/
Unfortunately, I can not download previously upload files. (I can only download those files that have been uploaded at new server by using filedepot frontend )
However, if ( by using filedepot frontend ) I move files from one folder to another folder; then I am able to download the files.
Could anybody shed a light on this issue?
Kind Regards,
David