Giter Site home page Giter Site logo

simogeo / filemanager Goto Github PK

View Code? Open in Web Editor NEW
937.0 98.0 349.0 5.54 MB

An open-source file manager released under MIT license. Up-to-date for PHP connector. This package is DEPRECATED. Now, please use RichFileManager available at : https://github.com/servocoder/RichFilemanager.

ASP 0.55% ColdFusion 0.74% Java 8.44% Lasso 0.06% C# 0.47% Perl 0.18% PHP 7.32% HTML 28.01% CSS 3.06% Shell 0.02% Python 0.28% JavaScript 48.27% CoffeeScript 2.21% ActionScript 0.41% ApacheConf 0.01%
filemanager jquery javascript connector php-connector php

filemanager's Introduction

Filemanager

FM is an open-source file manager released under MIT license. It is an alternative to elfinder or CKFinder.

IMPORTANT: This package is DEPRECATED.

Now, please use RichFileManager package with a number of new features and improvements.

Support

Filemanager is under free license. If you want to support the filemanager development or just thank its main maintainer by paying a beer, you can make a donation by clicking the following button : Donate

Main features

  • A Filemanager relying on jquery.
  • Available in more than 20 languages.
  • Highly customizable
  • Can work as standalone application
  • Easy integration with RTE like CKEditor, TinyMCE and so on.
  • Easy integration with colorbox jquery plugin or HTML simple textfield
  • Several computer language connectors available. PHP is up-to-date
  • Ability to upload, delete, modify, download and move files
  • Ability to create folders
  • Support user permissions - based on session
  • Handle system permissions
  • Ability to pass config user file in URL
  • Multiple uploads support - based on dropzonejs
  • Online text / code edition - based on codeMirror
  • Online documents viewer - based on viewerJS
  • Opening a given folder
  • Opening exclusively a given folder
  • Passing parameters to the FM
  • File types restriction
  • Video and audio player relying on web browser capabilities
  • Textbox Search filter
  • Thumbnails generation
  • Image auto-resize
  • File size limit
  • File exclusion based on name and patterns
  • Images files only
  • Prevent files overwriting (or not)
  • Switch from list to grid view and vice-versa
  • Copy direct file URL
  • CSS Themes - Please, share your themes with others !
  • and more ...

Screenshot

Filemanager Screenshot

Documentation

Filemanager is highly documented on the wiki pages. API, see below.

Installation and Setup

Preamble

Since many changes have been done recently, only PHP and MVC connectors are now available. You can try the latest version for others connectors, but with no warranty they implement all features and work correctly.

To use other connectors, please download v0.8 version from https://github.com/simogeo/Filemanager/archive/v0.8.zip (PHP, ASHX, ASP, CFM, lasso, PL and JSP connectors are available)

A JSP/Java connector implementation is available at : https://github.com/th-schwarz/C5Connector.Java


(1) Check out a copy of the FileManager from the repository using Git :

git clone http://github.com/simogeo/Filemanager.git

or download the archive from Github : https://github.com/simogeo/Filemanager/archive/master.zip

You can place the FileManager anywhere within your web serving root directory.

(2) Make a copy of the default configuration file ("filemanager.config.default.json" located in the scripts directory), removing the '.default' from the end of the filename, and edit the options according to the following wiki page : https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file Having a look on configuration cases study may also be helpful to you : https://github.com/simogeo/Filemanager/wiki/Specify-user-folder%2C-configuration-cases

(3a) If you are integrating the FileManager with FCKEditor, open your fckconfig.js file and find the lines which specify what file browser to use for images, links, etc. Look toward the bottom of the file. You will need to change lines such as this:

FCKConfig.ImageBrowser = false ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=../../connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;

...to this:

FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = '[Path to Filemanager]/index.html' ;

(3b) If you are integrating the FileManager with CKEditor 3.x or higher, simply set the URL when you configure your instance, like so:

CKEDITOR.replace('instancename', {
	filebrowserBrowseUrl: '[Path to Filemanager]/index.html',
	...other configuration options...
});

If you want to use the modal dialog mode (instead of pop-up), please refer to the dedicated wiki page.

(3c) If you are integrating the FileManager with TinyMCE (>= 3.0), you should:

Create a Javascript callback function that will open the FileManager index.html base page (see URL below for examples) Add a line like: "file_browser_callback : 'name_of_callback_function'" in the tinyMCE.init command See http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_a_custom_file_browser for more details.

See also the dedicated wiki page, with TinyMCE 4 sample : https://github.com/simogeo/Filemanager/wiki/How-to-use-the-Filemanager-with-tinyMCE-3-or-4

(4) Last but not least, worry about security!

For PHP connector : copy/paste the /connectors/php/default.config.php to /connectors/php/user.config.php to define your own authentication function. To do so, you will find an example on the dedicated wiki page.

jQuery dependency and compatibility

We try to keep updating jQuery core library regularly. If, for any reason, you can't use the embedded jQuery version just now that the Filemanager will probably work with a jQuery version >= 1.6. You'll have to use the jQuery.migrate() plugin to use it with jQuery version 1.9+.

Set-up & security

Important : The Filemanager is designed to work without any special configuration but using it without any configuration is VERY unsafe. Please set-up your own authentication function, based on default file and refering to the dedicated wiki page.

API

Connector Location

You can create a connector for your server side language of choice by following this simple API. You must have a script at the following location which can respond to HTTP GET requests by returning an appropriate JSON object:

[path to FileManager]/connectors/[language extension]/filemanager.[language extension]

FileManager currently includes connectors for PHP, MVC, JSP, lasso, ASP, ASHX, PL and CFM in the following locations:

PHP: .../connectors/php/filemanager.php
ASP.NET MVC Framework .../connectors/mvc/FilemanagerController.cs
JSP: .../connectors/jsp/filemanager.jsp
lasso: .../connectors/lasso/filemanager.lasso
ASP: .../connectors/asp/filemanager.asp
ASHX: .../connectors/ashx/filemanager.asp
PL: .../connectors/pl/filemanager.pl
CFM: .../connectors/cfm/filemanager.cfm

As long as a script exists at this location to respond to requests, you may split up the code (external libraries, configuration files, etc.) however you see fit.

Error Handling

Every response should include two keys specific to error handling: Error, and Code. If an error occurs in your script, you may populate these keys with whatever values you feel are most appropriate. If there is no error, Error should remain empty or null, and Code should be empty, null, or zero (0). Do not use zero for any actual errors. The following example would be an appropriate response if the connector uses an external file for configuration (recommended), but that file cannot be found:

{
  "Error": "Configuration file missing.",
  "Code":  -1
}

Methods

Your script should include support for the following methods/functions. GET requests from FileManager include a parameter "mode" which will indicate which type of response to return. Additional parameters will provide other information required to fulfill the request, such as the current directory.

getinfo

The getinfo method returns information about a single file. Requests with mode "getinfo" will include an additional parameter, "path", indicating which file to inspect. A boolean parameter "getsize" indicates whether the dimensions of the file (if an image) should be returned.

Example Request:

[path to connector]?mode=getinfo&path=/UserFiles/Image/logo.png&getsize=true

Example Response:

{
  "Path": "/UserFiles/Image/logo.png",
  "Filename": "logo.png",
  "File Type": "png",
  "Preview": "/UserFiles/Image/logo.png",
  "Protected": 0,
  "Properties": {
    "Date Created": null,
    "Date Modified": "02/09/2007 14:01:06",
    "filemtime": 1360237058,
    "Height": 14,
    "Width": 14,
    "Size": 384
  },
  "Error": "",
  "Code": 0
}

The keys are as follows:

Path: The path to the file. Should match what was passed in the request.

Filename: The name of the file, i.e., the last part of the path.

File Type: The file extension, "dir" if a directory, or "txt" if missing/unknown.

Preview: Path to a preview image. If the file is an image that can be displayed in a web browser (i.e., gif, jpg, or png), you should return the path to the image. Otherwise, check to see if there is a matching file icon based on the file extension, constructing the path like so:

	Directories: images/fileicons/_Open.png		
	Files: images/fileicons/[extension].png		
	Unknown: images/fileicons/default.png
	
Protected: Indicates if the file has some reading / writing restrictions. If not, set to 0. Else set to 1. 

Properties: A nested JSON object containing specific properties of the file.

	Date Created: The file's creation date, if available.
	Date Modified: The file's modification date, if available.
	Height: If an image, the height in pixels.
	Width: If an image, the width in pixels.
	Size: The file size in bytes.

Capabilities (optional): You can limit the operation buttons shown for a specific file. It is an array containing ['select','delete','rename','download'] (for all capabilities), or [] (for no capabilities). If not present, all capabilities are enabled.

Error: An error message, or empty/null if there was no error.

Code: An error code, or 0 if there was no error.

getfolder

The getfolder method returns an array of file and folder objects representing the contents of the given directory (indicated by a "path" parameter). It should call the getinfo method to retrieve the properties of each file. A boolean parameter "getsizes" indicates whether image dimensions should be returned for each item. Folders should always be returned before files. Optionally a "type" parameter can be specified to restrict returned files (depending on the connector). If a "type" parameter is given for the main index.html URL, the same parameter value is reused and passed to getfolder. This can be used for example to only show image files in a file system tree.

Example Request:

[path to connector]?mode=getfolder&path=/UserFiles/Image/&getsizes=true&type=images

Example Response:

{
  "/UserFiles/Image/logo.png": {
    "Path": "/UserFiles/Image/logo.png",
    "Filename": "logo.png",
    "File Type": "png",
    "Preview": "/UserFiles/Image/logo.png",
    "Protected": 0,
    "Properties": {
      "Date Created": null,
      "Date Modified": "02/09/2007 14:01:06",
      "filemtime": 1360237058,
      "Height": 14,
      "Width": 14,
      "Size": 384
    },
    "Error": "",
    "Code": 0
  },
  "/UserFiles/Image/icon.png": {
    "Path": "/UserFiles/Image/icon.png",
    "Filename": "icon.png",
    "File Type": "png",
    "Preview": "/UserFiles/Image/icon.png",
    "Properties": {
      "Date Created": null,
      "Date Modified": "02/09/2007 14:01:06",
      "filemtime": 1360237058,
      "Height": 14,
      "Width": 14,
      "Size": 384
    },
    "Error": "",
    "Code": 0
  },
  "/UserFiles/folder/":{
    "Path":"/UserFiles/folder/",
    "Filename":"folder",
    "File Type":"dir",
    "Preview":"images\/fileicons\/_Open.png",
    "Properties": {
      "Date Created":null,
      "Date Modified": "02/09/2007 14:01:06",
      "filemtime": 1360237058,
      "Height":null,
      "Width":null,
      "Size":null
    },
    "Error":"",
    "Code":0
  }
}

Each key in the array is the path to an individual item, and the value is the file object for that item.

rename

The rename method renames the item at the path given in the "old" parameter with the name given in the "new" parameter and returns an object indicating the results of that action.

Example Request:

[path to connector]?mode=rename&old=/UserFiles/Image/logo.png&new=id.png

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Old Path": "/a_folder_renamed/thisisareallylongincrediblylongfilenamefortesting.txt",
  "Old Name": "thisisareallylongincrediblylongfilenamefortesting.txt",
  "New Path": "/a_folder_renamed/a_renamed_file",
  "New Name": "a_renamed_file"
}

move

The move method move "old" file or directory to specified "new" directory. It is possible to specify absolute path from fileRoot dir or relative path from "old" item. "root" value is mandatory to secure that relative paths don't get above fileRoot.

Example Request: Move file

[path to connector]?mode=move&old=/uploads/images/original/Image/logo.png&new=/moved/&root=/uploads/images/

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Old Path": "/uploads/images/original/Image/",
  "Old Name": "logo.png",
  "New Path": "/uploads/images/moved/",
  "New Name": "logo.png"
}

Example Request: Move directory to not existing directory (will be created)

[path to connector]?mode=move&old=/uploads/images/original/Image&new=../new_dir/&root=/uploads/images/

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Old Path": "/uploads/images/original/",
  "Old Name": "Image",
  "New Path": "/uploads/new_dir/",
  "New Name": "Image"
}

delete

The delete method deletes the item at the given path.

Example Request:

[path to connector]?mode=delete&path=/UserFiles/Image/logo.png

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Path": "/UserFiles/Image/logo.png"
}

add

The add method adds the uploaded file to the specified path. Unlike the other methods, this method must return its JSON response wrapped in an HTML <textarea>, so the MIME type of the response is text/html instead of text/plain. The upload form in the File Manager passes the current path as a POST param along with the uploaded file. The response includes the path as well as the name used to store the file. The uploaded file's name should be safe to use as a path component in a URL, so URL-encoded at a minimum.

Example Response:

{
  "Path": "/UserFiles/Image/",
  "Name": "new_logo.png",
  "Error": "No error",
  "Code": 0
}

replace

The replace method allow the user to replace a specific file whatever the new filename - at least, the new file should have the same extension the original has. The old file is automatically overwritten. Unlike the other methods, this method must return its JSON response wrapped in an HTML <textarea>, so the MIME type of the response is text/html instead of text/plain. The dynamic upload form in the File Manager passes the current file path as a POST param along with the uploaded file. The response includes the path as well as the name used to store the file.

Example Response:

{
  "Path": "/UserFiles/Image/",
  "Name": "new_logo.png",
  "Error": "No error",
  "Code": 0
}

editfile

The editfile method returns the content of a given file (passed as parameter). It gives the user the ability to edit a file online (extensions are specified in configuration file). Handled as GET request.

Example request:

[path to connector]?mode=editfile&path=/UserFiles/MyFolder/myfile.txt

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Path": "/UserFiles/MyFolder/myfile.txt",
  "Content": "Content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n\Phasellus eu erat lorem.\r\n\r\n\Bye!"
}

savefile

The save method will overwrite the content of the current file. The edit form in the File Manager passes the mode (as savefile), path of the current file and the content as POST parameters.

Example Response:

{
  "Error": "No error",
  "Code": 0,
  "Path": "/UserFiles/MyFolder/myfile.txt"
}

preview

The preview method serves the requested image for displaying. The image path is passed through the path parameter. If thumbnail=true parameter is passed, the method will return an image thumbnail. An extra parameter such as UNIX time can be added to the URL to prevent cache issue.

Example Request:

[path to connector]?mode=preview&path=/UserFiles/new%20logo.png&thumbnail=true

addfolder

The addfolder method creates a new directory on the server within the given path.

Example Request:

[path to connector]?mode=addfolder&path=/UserFiles/&name=new%20logo.png

Example Response:

{
  "Parent": "/UserFiles/",
  "Name": "new_logo.png",
  "Error": "No error",
  "Code": 0
}

download

The download method serves the requested file to the user. We currently use a MIME type of "application/x-download" to force the file to be downloaded rather than displayed in a browser. In the future we may make exceptions for specific file types that often have in-browser viewers such as PDF's and various movie formats (Flash, Quicktime, etc.).

Example Request:

[path to connector]?mode=download&path=/UserFiles/new%20logo.png

MIT LICENSE

Copyright (c) 2011-2013 Jason Huck, Simon Georget http://opensource.org/licenses/MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

filemanager's People

Contributors

bulentsakarya avatar christianschmidt1981 avatar claudep avatar dariodp avatar dazzhands avatar dholmes avatar dtricky avatar fillmorejd avatar froggdev avatar hammond13 avatar intoccabil avatar jasonhuck avatar liferealized avatar michalmrzyk avatar mickeyze avatar miladganjali avatar moacirosa avatar mystralkk avatar oguzhantopcu avatar pefringant avatar phil-davis avatar psolom avatar rip747 avatar robyer avatar simogeo avatar stefanogualdi avatar theinfernox avatar zapik avatar zenlor avatar zeroasterisk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filemanager's Issues

Files can be renamed to any extension

Maybe this isn't a huge issue, but it seems files can be renamed to any extension after uploading. If someone got a malicious php file uploaded as a .jpg for example, they could rename it in the file manager afterwards.

Filemanager interface doesn't show authentication error

I use the jsp connector.

I'm testing the authentication method in filemanager.jsp.

If the authentication fails, the connector have to send the browser and error, and the filemanger interfaz should display this error to inform the user.

The connector returns the error, but the interface doesn't show it to the user.

Here is the server response when the autenthication fails:
{"Code":"-1","Error":"No estás autorizado para usar el administrador de archivos.","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null}}

New folder can not be selected

If the root folder is not empty and you add new folder under the root, that new folder is shown in the folder tree but it can't be selected and its context menu can't be shown.

file extension check - restriction on upload

One question though - what type of security concerns should I be worried about? As far as I can tell, just like the file upload utility in FCKeditor, there's nothing really stopping anyone from using Filemanager, just by visiting it and using the interface bare. That allows anyone to upload, it seems anything. And unlike the built-in file uploader in FCKeditor, there doesn't seem to be a way to state what file types are OK to upload and what file types aren't. I couldn't find any documentation that deals with this type of stuff - is there documentation for this wonderful project - other than the Readme?

http://forum.filemanager.corefive.com/topic/security-concerns#18308000000230010

Path after deleteing folder

If you have only one folder, e.g. /my-folder/ and when you delete that folder current path is still /my-folder/ but it should be /

why show select, if the filemanager is not used in CKEditor?

i dont understand why the select button is shown when the filemanger is used as standalone fm?

i add:
// blend out if filemanager was not load in a CKEditor instance
if(window.opener)

in line 456 of the filmanager.js to prevent this

can you implement this by default, cause it makes no sense to show a button without function, or is it also for something else?

Language string error

Language string error on INVALID_FILE_UPLOAD

.....
"INVALID_FILE_UPLOAD": "Invalid file upload.",
.....

FIX to work with jQuery 1.4

Issues with jQuery 1.4 is down to using jquery.splitter. This can simply be replaced with the newer jquery.layout

Change line 662 to:

// Provides support for adjustible columns.
$('#splitter').layout({
useStateCookie: true, // enable cookie-based state-management
west__size: 200
});

and add classes in the html to:

div id="filetree" class="ui-layout-west" and
div id="fileinfo" class="ui-layout-center"

Also
jQuery.form must be updated to latest version

Security Concert

Hi Simogeo,

there is a security issue in fileManager that I would like to discuss; currently we have a "filemanager.config.js" which sets up the variables. As a malicious user, I can change the fileRoot variable to something else; for example, on a .NET site, if I change it to /, it displays the root folder and all the contents.

As I see, those config should really come from the connector, as it shouldn't be a concern of the fileManager; Currently I have solved this issue on my by using something like this:

<script type="text/javascript" src="connectors/aspx/filemanager.aspx?mode=config"></script>

so I am basically passing the configuration from connector as a JS file which requires no other changes; As an idea, perhaps it should be read as a JSON object to fit with the rest.

Perhaps everyone has already adapted similar ideas; but someone new may benefit from this information.

Clarification: By the way, the connector is checking to see if the path is allowed or not. in above specific method, that value is served from one page, instead of two.

does the fileManager itself needs fileRoot or can it be passed on the responses??

Limit browser to images

Is limiting Filemanager to an image-only browser completely implemented? I see some references to a type=image query parameter, but it doesn't seem to be carried on on various AJAX calls. Can you tell us more about this?

File rename overwrites old file

If you have two files with different names, and then rename one of the files so the two names became the same, one of the files will be overwritten.

TinyMCE integration

I'm currently playing with Filemanager and I'm rather pleased until now. Here is a patch for TinyMCE integration.

Disable upload

Hi there, thanks a lot for this great fileManager; I have a question though; is there any way to disable upload feature? perhaps by setting the configuration file?

Also, are you accepting any aspx connector?

encodeURIComponent(path)

to retrieve file with special characters (at least on windows) it is necessary to use encodeURIComponent() when passing the querystring parameters of paths in filemanager.js.

I modified mine and now work pretty well with asp.net connector.

add showFullPath to the filemanager.config.js

can you add a showFullPath option to the config, so that the full path name is shown in the uploader h1 instead of the shortend version, where it removes the fileRoot path from the path?

just add an if before line 72 in the filemanager.js
$('#uploader h1').text(lg.current_folder + path); //disp(path)
and remove the disp() function..

JSP jqueryFileTree connector encoding problem

The JSP connector of the FileTree doesn't work fine with file names or folder names that include exotic chars.

If I have a folder in the server with a special chars name (España), it is shown well formatted in the main frame, but with encoding errors in the FileTree (Espa�a)

This interrogation symbols means that the text is in ISO encoding but rendering in UTF-8 (you can try it creating a plain text file with the text "España", save it in ISO-ANSI and open it in the browser with UTF-8 character set).

Changing the encoding of the file to UTF-8, and doing the URLDecoder in ISO-8859-1, all works fine (I don't understand why it is necessary to use ISO in the decoder instead of UTF-8 :?)

dir = URLDecoder.decode(dir, "ISO-8859-1");

[JSP connector] File upload error in a folder with exotic characters

I'm getting an error when try to upload a file into a folder that has exotic chars in its name (España for example).

The POST request to the server returns this text:

<textarea>{}</textarea>

and the interface shows a "undefined" message.

The addfolder method works fine, you can create a folder inside another with exotic chars.

up to now I can't found a solution or workaround, but I'm working on it

getfolder method response example not valid JSON.

I'm working on an ASP.Net connector and ran into an issue when attempting to reproduce the example/expected JSON string given in the ReadMe.txt file. The example response doesn't pass the JSON lint located at: http://www.jsonlint.com. I've taken a look at the JavaScript code and the key isn't being used specifically in the list (from what I could tell at this hour). They key being the absolute path to the file tends to be redundant to me as well. I have created code that omits that key but still returns a valid JSON array of objects which appears to be working at this time.

I would like to propose that new example code would be:

[
    {
        "Path": "/UserFiles/Image/logo.png",
        "Filename": "logo.png",
        "File Type": "png",
        "Preview": "/UserFiles/Image/logo.png",
        "Properties": {
            "Date Created": null,
            "Date Modified": "02/09/2007 14:01:06",
            "Height": 14,
            "Width": 14,
            "Size": 384 
        },
        "Error": "",
        "Code": 0 
    },
    {
        "Path": "/UserFiles/Image/icon.png",
        "Filename": "icon.png",
        "File Type": "png",
        "Preview": "/UserFiles/Image/icon.png",
        "Properties": {
            "Date Created": null,
            "Date Modified": "02/09/2007 14:01:06",
            "Height": 14,
            "Width": 14,
            "Size": 384 
        },
        "Error": "",
        "Code": 0 
    }
]

Does this work? I'm in early in my development of this connector at this point. I will "genericize" the code and pass it on to you guys for the community.

Regards,

-- Mikhey

Not show the file only folder

I have updated filemanager on my cms (Flatz-Cms).
When i choose a folder on the right i have only the folder the file not.
I have read the code of many files and i have use firebug.
The problem is that i go with my browser of the url get by firebug i get this for example:
{"/uploads/galleria/2/min/":{"Path":"/uploads/galleria/2/min/","Filename":"min","File Type":"dir","Preview":"images/fileicons/_Open.png","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null},"Error":"","Code":0},"/uploads/galleria/2/2010-02-19_154856.jpg":{"Path":"/uploads/galleria/2/2010-02-19_154856.jpg","Filename":"2010-02-19_154856.jpg","File Type":"jpg","Preview":"connectors/php/filemanager.php?mode=preview&path=/uploads/galleria/2/2010-02-19_154856.jpg","Properties":{"Date Created":null,"Date Modified":"27 Aug 2010 18:19","Height":351,"Width":530,"Size":202345},"Error":"","Code":0},"/uploads/galleria/2/idg/":{"Path":"/uploads/galleria/2/idg/","Filename":"idg","File Type":"dir","Preview":"images/fileicons/_Open.png","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null},"Error":"","Code":0},"/uploads/galleria/2/2.jpeg":{"Path":"/uploads/galleria/2/2.jpeg","Filename":"2.jpeg","File Type":"jpeg","Preview":"connectors/php/filemanager.php?mode=preview&path=/uploads/galleria/2/2.jpeg","Properties":{"Date Created":null,"Date Modified":"27 Aug 2010 18:20","Height":1024,"Width":1280,"Size":986444},"Error":"","Code":0}}
while the html that i read on firebug are:
{"/uploads/galleria/2/min/":{"Path":"/uploads/galleria/2/min/","Filename":"min","File Type":"dir","Preview":"images/fileicons/_Open.png","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null},"Error":"","Code":0},"/uploads/galleria/2/idg/":{"Path":"/uploads/galleria/2/idg/","Filename":"idg","File Type":"dir","Preview":"images/fileicons/_Open.png","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null},"Error":"","Code":0}}
At same url!
i have no idea. i have updated only the file not the config that i use on the cms.

Ckeditor And Langcode

Ckeditor when open the window of filemanager in get this write &CKEditorFuncNum=1&langCode=it.
Filemannager not use the value of langcode to use it automatically?

File extension case insensitive

Hello.

Now, the preview option for images is case sensitive, if I upload a file named "hello.PNG", the filemanager doesn't show the preview of the image because of the "images" array in the configuration file has lowercase file extensions.

It can be solved with a "strtolower" in the PHP connector, and "equalsIgnoreCase" in the JSP connector.

Regards.

Invalid file upload

Hi, I'm having a problem, I can't upload images, any time I try, the same message appears:

{"Error":"Invalid file upload.","Code":"-1","Properties":{"Date Created":null,"Date Modified":null,"Height":null,"Width":null,"Size":null}}

Does anyone know a fix for this? Thanks

Problem Ckeditor with subfolder

I have the ckeditor with filemanager in subfolder while the cms is are in another subfolder.
If i select the img by file manager the path of img was "/example.png" while the path of the site are "http://example.xx/example".
i have modded the line 189 of filemanager.js with this window.opener.CKEDITOR.tools.callFunction($.urlParam('CKEditorFuncNum'), data['Path'].substr(1));
that remove the slash.
Domain http://example.xx/example
Img is http://example.xx/example/example.png
Img is after select http://example.xx/example.png
If the site are in a subfolder i have the problem.

Wrong download request example

The example of a download request in the ReadMe file ii:
[path to connector]?mode=download&path=/UserFiles/&name=new%20logo.png

In fact, it should be:
[path to connector]?mode=download&path=/UserFiles/new%20logo.png

Or else it is a coding error...

Encoding problems with special characters like 'ñ' or 'á'

Hi.

The Filemanager interface has some problems when the text has, for example, spanish characters like 'ñ' or accented vowels (á,é,í,ó,ú).

I'm having these problems:

  • The language strings in the es.js file are shown with encoding erors in interface. For example, the authentication failed text is shown: "No estás autorizado para usar el administrador de archivos.", but would be "No estás autorizado para usar el administrador de archivos.
  • When I try to create a new folder with special chars, like "España", the folder is created in the server with the name "España", and the interface shows it with the same wrong format.
  • If I have a folder in the server with a special chars name (España again), it is shown well formatted in the main frame, but with encoding errors in the FileTree (Espa�a)
  • If I click on the folder in the main frame (the well formed one), I get the "Folder not found error"). I attach a screenshot of the error with the Firebug log

  • If I click on the FileTree folder, I get the sale "Folder not found error" but in the case, as the filetree shows the folder with encoding problems, the request and response of the server is quite differente. A scrrenshot...

As you can see, the request to the jqueryFileTree.jsp file returns a 500 server error. Here is the server exception:

java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "uF" at java.net.URLDecoder.decode(Unknown Source) at org.apache.jsp.ckeditor.filemanager.scripts.jquery_filetree.connectors.jqueryFileTree_jsp._jspService(jqueryFileTree_jsp.java:104) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Unknown Source)

I'm trying to solve the problems but I'm having no success.

I realized that the Filemanager interface uses UTF-8 as charset, but the files are saved in ANSI format, that can generate problems (If you save a file (HTML for example) with special chars in ANSI, and later you open it in UTF-8, the special chars will be rendered with errors).

My system is a Windows XP OS with Apache Tomcat 6.0.20

I hope you can solve these problems. I'll continue with my test in order to find a solution.

Regards.

PD: I apologize if my explanations aren't so good, I haven't a high english level.

Wrong filename with JSP connector and Internet Explorer 8

Hi.

Using the jsp connector and IE 8, when you upload a file, it is renamed in the server with the fullpath of the local filesystem.

For example, if I upload a file located on my desktop folder, the uploaded file name will be "CDocumentsandSettingsmyUsernameDesktopFilename"

I've tested it with other browsers and connectors and works fine.
JSP connector:

  • Firefox: OK
  • Chrome: OK
  • IE 8: Error

PHP connector:

  • Firefox: OK
  • Chrome: OK
  • IE 8: OK

Please add Swedish (sv) translations

No Swedish (sv) translation exists. I did a quick translation from 'en', and included it here:

{
"AUTHORIZATION_REQUIRED": "Du är inte behörig att använda filemanager.",
"INVALID_ACTION": "Felaktig åtgärd.",
"MODE_ERROR": "Mode error.",
"DIRECTORY_ALREADY_EXISTS": "Mappen '%s' finns redan.",
"FILE_ALREADY_EXISTS": "Filen '%s' finns redan.",
"UNABLE_TO_CREATE_DIRECTORY": "Kan ej skapa mapp %s.",
"INVALID_VAR": "Felaktig variabel %s.",
"DIRECTORY_NOT_EXIST": "Mappen %s finns inte.",
"UNABLE_TO_OPEN_DIRECTORY": "Kan ej öppna mappen %s.",
"ERROR_RENAMING_DIRECTORY": "Kan ej byta namn på mappen %s till %s.",
"ERROR_RENAMING_FILE": "Kan ej byta namn på filen %s till %s.",
"INVALID_DIRECTORY_OR_FILE": "Felaktig mapp eller fil.",
"INVALID_FILE_UPLOAD": "Fel vid uppladdning av fil.",
"UPLOAD_FILES_SMALLER_THAN": "Var vänlig ladda upp filer mindre än %s.",
"UPLOAD_IMAGES_ONLY": "Du kan endast ladda upp bilder, inga andra filtyper stöds.",
"UPLOAD_IMAGES_TYPE_JPEG_GIF_PNG": "Du kan endast ladda upp bilder av typen JPEG, GIF eller PNG.",
"FILE_DOES_NOT_EXIST": "Filen %s finns inte.",
"LANGUAGE_FILE_NOT_FOUND": "Språkfil saknas.",
"default_foldername": "Min mapp",
"prompt_foldername": "Ange namnet på den nya mappen",
"no_foldername": "Inget mappnamn angivet.",
"create_folder": "Skapa mapp",
"cancel": "Avbryt",
"select_from_left": "Välj från vänster.",
"fck_select_integration": "'Select-funktionen' används bara av integrationen med FCKEditor.",
"new_filename": "Ange nytt namn på filen",
"successful_rename": "Namnbyte utfört.",
"rename": "Byt namn",
"confirmation_delete": "Är du säker på att du vill radera filen?",
"successful_delete": "Radering utförd.",
"successful_added_file": "En ny fil har lagts till.",
"successful_added_folder": "En ny mapp skapades.",
"select": "Välj",
"download": "Ladda ner",
"del": "Radera",
"parentfolder": "Upp en nivå",
"dimensions": "Dimension",
"created": "Skapad",
"modified": "Senast ändrad",
"size": "Storlek",
"name": "Namn",
"gotoroot": "Gå till /",
"could_not_retrieve_folder": "Kan ej läsa mappens innehåll.",
"yes": "Ja",
"no": "Nej",
"upload": "Ladda upp",
"new_folder": "Ny mapp",
"grid_view": "Byt till tabellvy.",
"list_view": "Byt till listvy.",
"current_folder": "Aktuell mapp: ",
"bytes": " bytes",
"kb": "kb",
"mb": "mb",
"gb": "gb"
}

Button labels not initialized

It is probably related to the work I've done for moving jqueryFileTree data retrieving in filemanager.js, but now my button labels do not initialize.

I saw that you moved the label initialization out of the main initialization function in commit d41db0f. But I don't understand why. Moreover, the autoload variable is nowhere explained. Why would we want to set it to false?

exploit

hi,

a hacker contacted me, because he found a few exploits in my cms "feindura".

one was because of the filemanager, so i thinks its interesting for you, hope you can restrict the path somehow..

he wrote:

The filemanager script does not apply base path restrictions on the path,
this allows for arbitrary file reads.
http://[host]/[path]/filemanager/connectors/php/filemanager.php?mode=download&path=[path/to/file]

[JSP connector] Encoding problem rendering language texts

Using the JSP connector, some messages with exotic chars are rendered with encoding problem, for example the AUTHORIZATION_REQUIRED spanish message:

Message text:

No estás autorizado para usar el administrador de archivos.

Shown text:

No estás autorizado para usar el administrador de archivos.

The á character means that a UTF-8 encoded text is rendered as ISO/ANSI.

As a workaround, I can solve the problem saving the es.js file in ISO/ANSI format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.