Hello.

Thanks for module.
Do you can add ability to download a folders too? Why module able download only files?

If ability to download a full folders as ZIP archive is heavy for web server, maybe possible make a download folders (then we checked) without adding to archive?

Comments

Nicolas Georget’s picture

StatusFileSize
new1.44 KB

Actually, it's already done. But I have only one question about that:

  1. Do you want to download a whole selected folder and its content. Included hidden files / folders and even what is not filtered by FileBrowser (BlackList / WhiteList)?
  2. Or Only files that handled by FileBrowser?

In case #1, it's simple but not always the goal.
In case #2, it's a bit tricky because FileBrowser does not refresh the DB <-> Folder's Content (and Sub-folders, etc...)
So if you create a new folder, put some files inside, but never "browsed" by FileBrowser, the archive will only contain the root files. And might be empty also!

I attached a test version. Expand it and move it into the FileBrowser module. Active it as any module. And test it on your devel environment. Not on your prod server!

infoweb13’s picture

In my case, i think, variant "1" will be good. For my, just need ability to download some checked folders\files in one archive.

I am have a question: Why functions download folders and download files is two different buttons? Why users can't download checked files and folders in one click, in one archive?

P.S.
Attachment test version is don't work (( I've enabled module. I checked necessary folders and select "Download selected folders as an ZIP archive (folders only)" and got browser page "page not found".

What i do wrong?

Thx.

Nicolas Georget’s picture

StatusFileSize
new1.72 KB

Why functions download folders and download files is two different buttons? Why users can't download checked files and folders in one click, in one archive?

Because Yoran has already implemented in the release version the "File Archive" action. If you are module Developer, you know that you only can "hook" a module. Means add a functionality. Therefore, to add the "Folder Archive" action for Filebrowser, you can only hook an action function (hook_filebrowser_actions_info). i.e. http://drupal.org/node/292
After all, It's pretty easy to merge to both actions. And sure Yoran will add the function if it works well.

Attachment test version is don't work (( I've enabled module. I checked necessary folders and select "Download selected folders as an ZIP archive (folders only)" and got browser page "page not found".
What i do wrong?

I knew my hook was buggy, but have a 404 error, this is odd. What is the URL ?
Maybe it comes from the function filebrowser_download_manager_process() in file browser.module
Can you modify in this file lines 574 & 577 the PHP header function Content-Disposition: inline to attachment as following:

if (eregi("MSIE", getenv("HTTP_USER_AGENT")) || eregi("Internet Explorer", getenv("HTTP_USER_AGENT"))) {
  header('Content-Disposition: attachment; filename="' . mb_convert_encoding(_filebrowser_safe_basename($filename), "ISO-8859-2", "UTF-8") . '";');
}
else {
  header('Content-Disposition: attachment; filename="' . _filebrowser_safe_basename($filename) . '";');
}

And try the new attachment. It should download the whole selected folder (and Only one selected folder. does not work yet with multiple folders).

Yoran’s picture

Status: Active » Fixed

Thanks for this Nicolas :)

Automatically closed -- issue fixed for 2 weeks with no activity.