Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about how filedownd.js works #265

Closed
5 of 17 tasks
badsaarow opened this issue Nov 20, 2017 · 4 comments
Closed
5 of 17 tasks

question about how filedownd.js works #265

badsaarow opened this issue Nov 20, 2017 · 4 comments
Assignees
Milestone

Comments

@badsaarow
Copy link

badsaarow commented Nov 20, 2017

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the Wiki. Especially deploy and configuration articles.
  • I have checked that the bug I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I realise that server-side connectors are provided by various contributors. The implementations are vary due to programming language features/limitations or other factors. Thus a particular connector may not implement, or partially implement, the API features.
  • I realise that any changes in configuration options and/or plugin parameters affect the plugin behavior. I specified all the differences from defaults in details.

I use the following server-side connector (check one):

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

I have a question about downloading.
I'm trying to use node js connector.
But downloading feature didn't work even if tried change filemanager.js code as guided Austill.

case 'download':
    // to make it works, you need to change filemanager.js downloadItem function, like this:
    /*
     var downloadItem = function(resourceObject) {
     var queryParams = {mode: 'download', path: resourceObject.id};
     var link = document.createElement("a");
     link.download = resourceObject && resourceObject.attributes && resourceObject.attributes.name;
     link.href = buildConnectorUrl(queryParams);
     link.click();
     };
     */

From above guide, node js might have a problem in using filedownloader, but I don't know why.
I'm stucked in usage of jquery filedownloader.

From filemanager.js, to download, it use as below.
$.fileDownload(buildConnectorUrl(queryParams));

But at that point buildConnectorUrl(queryParams) return "/api/filemanager?mode=download&path=%2FMy+folder%2F22-23.pdf&time=1511162440227".
That response is just
{"data":[{"id":"/2017/My folder/22-23.pdf","type":"file","attributes":{"created":"2017-11-20T05:46:25.302Z","modified":"2017-11-20T05:46:25.332Z","name":"22-23.pdf","path":"/2017/My folder/22-23.pdf","readable":1,"writable":1,"timestamp":""}}]}

From filedownloader.js 's guide, it's parameter is url. I don't know how it can download that.
I compared to fm.devale.pro. Still in stuck in understanding.

Sorry for my poor understanding and beginner-level question.

@psolom
Copy link
Owner

psolom commented Nov 20, 2017

@jlaustill, @forestlake any ideas?

@psolom
Copy link
Owner

psolom commented Nov 21, 2017

I have found a solution. It will require some time to make changes (affect all connectors). I am going to implement it up to the next week. If you have made some improvements to NodeJs connector to this point, then it's time to share them to avoid conflicts.

@badsaarow
Copy link
Author

I just modified some configuration to Nodejs connector, so there nothing to conflicts you plan to implementing. Thanks.

@psolom
Copy link
Owner

psolom commented Dec 20, 2017

Released in v2.7.0

@psolom psolom closed this as completed Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants