angular-filemanager icon indicating copy to clipboard operation
angular-filemanager copied to clipboard

Ability to download or preview files by ID

Open Nevario opened this issue 8 years ago • 3 comments

Hi,

Firstly, thank-you for a great library!

It would be very useful if we could supply an ID attribute from list and then trigger downloads or previews from this ID, rather than having to do a lookup on the server of the current path.

{ "result": [ 
    {
        "name": "magento",
        "id":"54787", // NEW
        "rights": "drwxr-xr-x",
        "size": "4096",
        "date": "2016-03-03 15:31:40",
        "type": "dir"
    }, {
        "name": "index.php",
        "id":"1215477", // NEW
        "rights": "-rw-r--r--",
        "size": "549923",
        "date": "2016-03-03 15:31:40",
        "type": "file"
    }
]}

Is there any plans to put this on the roadmap?

Thanks, Tim

Nevario avatar Jul 31 '16 05:07 Nevario

This would probably also be useful for deleting files.

Currently, there is nothing stopping anyone uploading two files with the same name to a folder. This means when we request the API to delete the file using only the name, the server may delete the wrong one...

How are others dealing with this?

Tim

Nevario avatar Aug 01 '16 23:08 Nevario

@joni2back I've been working with an angular developer to implement this feature in my application.

I'd like to share the solution for consideration to be added into the project. Some 'breaking' API changes have been made. For example, to remove one or more files has changed from:

{
    "action": "remove",
    "items": ["/public_html/index.php"],
}

to

{
    "action" : "remove",
    "items" : [
        {
            "id" : "03b08ec83ec103b",
            "filePath" : "/public_html/index.php"
        }
    ]
}

Therefore, could you please make a new branch so that we can run tests and provide fixes for the various backend bridges?

Tim

Nevario avatar Aug 08 '16 00:08 Nevario

Hi, Is there any development on this feature ? I need this too :) The idea could simply be to have meta data for file items that are sent to the backend for any request. Would you mind sharing the changes you made to have the id of the file when listing and then download using this id. I use a custom bridge, so I only need the front-end part :) Thanks !

VincentBlouin avatar May 16 '17 18:05 VincentBlouin