1

I needed a web file manager able to navigate a given directory tree on a server. The best solution I could find was KCFinder available for free and considered reliable as long as I could read until now.

So I downloaded the last stable versione (3.12) and made a basic installation on my server.

I simply copied the whole kcfinder-3.12 folder in my wwwroot on a machine running Linux Debian+Apache+PHP5 then modified the kcfinder/conf/config.php so that any user was allowed to access:

  'disabled' => false

The default settings for folders remained as follows:

  'uploadURL' => "upload",
  'uploadDir' => "",

This should give me the right to browse, download and upload files located in the subfolder kcfinder/upload/

But when I run the application, it actually shows me only the subfolder "files/" contained in the above said upload folder despite many other exists created via shell.

I know this behaviour comes from the types settings:

  'types' => array(

    // (F)CKEditor types
        'files'   =>  "",
        'flash'   =>  "swf",
        'images'  =>  "*img",

    // TinyMCE types
        'file'    =>  "",
        'media'   =>  "swf flv avi mpg mpeg qt mov wmv asf rm",
        'image'   =>  "*img",
    ), 

enter image description here

But it's not very clear to me how those categories are supposed to fit in my expectations and how I'm instead allowed to have a web based file browser with no restrictions starting from a given directory.

Does anyone know what I'm doing wrong and if there's a way to get total access to a given directory? Here I talked about KCFinder but I'm available to listen any other option as long as it fulfills my request.

Diego D
  • 6,156
  • 2
  • 17
  • 30
  • Is it ok : a simple http server with download support – totti Oct 10 '14 at 07:01
  • :) no it wouldn't be enough because I needed a fully powered file manager able to upload, download and delete files on any arbitrary directory even beyond the wwwroot. Anyway in the end I found Pydio to be perfectly suitable for my needs but the company in the end preferred to craft its own proprietary tool. What makes me wonder is why nobody was able to give such a simple answer to get this bounty doing zero efforts. – Diego D Oct 11 '14 at 12:04
  • Are the other "folders" symlinks? – Tserkov Oct 12 '14 at 05:24
  • symlinks are not part of my scenario despite in general it was a possible option. I involved symlinks only to fool kcfinder so it accessed the target folder while he was thinking it was its internal directory called file – Diego D Oct 13 '14 at 07:44
  • ah anyway I got only now the real meaning of your question... no those "folders" I expected to appear there were not symlinks. – Diego D Oct 13 '14 at 07:57

2 Answers2

1

A couple at things that could be doing that:

1) Check folder permissions

2) Clear your browser cache and reload page

3) And configurations from the documentation:

'uploadDir' => "",

This setting is used when KCFinder can't automatically detect its local filesystem path to the folder specified in uploadURL setting. Change this setting when KCFinder can't fetch the local filesystem path automatically.

'dirPerms' => 0755,
'filePerms' => 0644,

Default filesystem permissions for new files and directories created with KCFinder. Windows servers will skip these settings.

More Information in: http://kcfinder.sunhater.com/install

c0utinh0
  • 179
  • 1
  • 8
  • I tried both before.. about folder permissions I even run a chmod -R 0777 * kcfinder. But yes honestly this consideration should make me think harder now. Because maybe kcfinder expects a given user to be the owner of browsable folders and that's why until now it only worked correctly when I left the kcfinder to decide that the "files" folder was up to him to create. All the other weird experiments could show me the complete tree but then failed when trying to access the single nodes. If that's the only way, it ends up being a bit frustrating. I can't change the owner of the target folder. – Diego D Oct 05 '14 at 14:30
  • the uploadDir is pointless in this case because anyway it works.. it just can't show me ALL the other subfolders if not "files". The permissions settings are used for files and directories it creates but I'm still addressing the browsing scenario. For the sake of completeness I want to remind that I'm talking about linux and ext3 fs – Diego D Oct 05 '14 at 14:34
  • Note 1: sudo chmod 777 -R If you do that, it wont be a problem of permissions in the folders, because all will have access. – c0utinh0 Oct 05 '14 at 14:35
  • Note 2 - try defining the permissions: 'dirPerms' => 0777, 'filePerms' => 0777, – c0utinh0 Oct 05 '14 at 14:36
  • Actually the machine where I'm supposed to run that stuff belongs to the company I work for and my user has no rights to run that sudo. For the settings you suggested I tried anyway but it didn't work – Diego D Oct 05 '14 at 14:44
  • I was thinking about my first comment again.. well actually I did create a symlink with my user via shell and the file browser considered it legit showing it only because its name was "files". So I can say for sure is not a matter of which user created the folders but their name. This discussion bring us back to the "types" settings that want contents to belong to strict categories hosted by well defined folders – Diego D Oct 05 '14 at 14:49
0

What you really need are two things:

1) Enable DAV extensions on your web server. This consists simply of enabling the stock mod_dav module.

2) Use any DAV-based file manager. Heck, there's one even for Android: https://play.google.com/store/apps/details?id=jp.ddo.shigadroid.webdavfilemanager&hl=en

For native Linux, you don't need any special client software. A brief googling around suggests that current Gnome and KDE desktops can natively access remote files via the DAV protocol. Here's a random page Google came up with, with examples: http://doc.owncloud.org/server/6.0/user_manual/files/files.html

I'm sure there are plenty of standalone DAV clients, that you can use to browse your web server via the DAV protocol, you can Google them up yourself.

Of course, there are some issues to work out here, regarding configuration, security, and permissions. You need to set aside some time to dig through mod_dav's documentation, and figure out exactly how you need your security setup to work.

Sam Varshavchik
  • 114,536
  • 5
  • 94
  • 148
  • That's not really what I was looking for, but at this point it really doesn't make any differnce. The bounty expired and who tried to address the problems of my kcfinder couldn't really identify the real cause. I guess my problem doesn't have any value for the community because it's probably very specific and difficult to diagnose using the input I used in my description. So there's no more reason to keep the question alive and since the webdav more or less gives a solution I will accept this answer. Anyway don't understimate the power of Pydio! @anyone – Diego D Oct 13 '14 at 07:31