Menu

#75 Download link with filelocker in subdirectory

v2
closed
nobody
None
1
2015-03-19
2013-08-21
Brad Landis
No

Small, but important bug. When I install filelocker in a subdirectory, it puts me to http://domain/file/download instead of http://domain/subdir/file/download.

The problem is at src/static/js/file.js:186. I'm fixing mine by putting my full root URL. Need some JS magic to make it work the right way.

Discussion

  • Brad Landis

    Brad Landis - 2013-08-22

    Found the correct way to change it. Here's the patch below inline.

    diff -rup /root/filelocker2-code-954-branches-2.6/src/static/js/file.js ./static/js/file.js
    --- /root/filelocker2-code-954-branches-2.6/src/static/js/file.js       2011-12-06 12:27:08.000000000 -0600
    +++ ./static/js/file.js 2013-08-22 15:17:00.000000000 -0500
    @@ -183,7 +183,7 @@ FLFile = function() {
         }
         function download(fileId)
         {
    -        window.location.href = window.location.protocol + "//" + window.location.host + "/file/download?fileId=" + fileId + "&_=" + $.now();
    +        window.location.href = FILELOCKER_ROOT + "/file/download?fileId=" + fileId + "&_=" + $.now();
         }
         function take(fileId)
         {
    
     
  • David Hutchins

    David Hutchins - 2014-05-09

    This has been committed to the 2.6 branch.

     
  • David Hutchins

    David Hutchins - 2015-03-19
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB