[TIC-Web] change the file download function 98/112498/2
authorChangHyun Lee <leechwin.lee@samsung.com>
Wed, 1 Feb 2017 07:48:00 +0000 (16:48 +0900)
committerChangHyun Lee <leechwin.lee@samsung.com>
Wed, 1 Feb 2017 07:51:35 +0000 (16:51 +0900)
Modified to nginx resource url instead of nodejs fs.

Change-Id: Ifcfb42a03841d8ddc17a4cf20ceeffb8da666da4
Signed-off-by: ChangHyun Lee <leechwin.lee@samsung.com>
public/src/js/page/image.js
server/routes/router.js

index d5afd4d..ba083e4 100644 (file)
@@ -30,7 +30,7 @@ define([
                         '<p class="image-list-name" title="<%= fileName %>"><%= fileName %></p>' +
                         '<p class="image-list-detail">Size: <%= fileSize %></p>' +
                         '<p class="image-list-detail">Updated: <%= fileTime %></p>' +
-                        '<a class="image-list-btndownload" href="<%= hrefPath %>" date-name="<%= fileName %>" download="download">Download</a>' +
+                        '<a class="image-list-btndownload" href="<%= hrefPath %>" date-name="<%= fileName %>">Download</a>' +
                      '</li>';
 
     function _initSocket(socket) {
@@ -49,7 +49,7 @@ define([
                     fileName: file.name,
                     fileSize: Util.bytesToSize(file.size),
                     fileTime: new Date(file.birthtime).toLocaleString(),
-                    hrefPath: '/api/fs/download/' + file.name
+                    hrefPath: '/tic/images/' + file.name
                 });
                 $imageList.append(imageItem);
             });
index ede8e34..49d392e 100644 (file)
@@ -10,10 +10,9 @@ router.use(function timeLog(req, res, next) {
 });
 
 /**
+ * @Deprecated - Use to path of nginx
  * API
- *
  * path : /api/fs/download
- *
  */
 router.get('/fs/download/:filename', function (req, res) {
     console.log('an api called that /api/fs/download/'+req.params.filename);