diff options
Diffstat (limited to 'static/js/upload.js')
-rw-r--r-- | static/js/upload.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/static/js/upload.js b/static/js/upload.js index a8a0e5a..da60c13 100644 --- a/static/js/upload.js +++ b/static/js/upload.js @@ -49,4 +49,19 @@ $(function () { function status(message) { $('#status').text(message); } -});
\ No newline at end of file + + function uploadedFilenameList() { + var xhr = new XMLHttpRequest(); + xhr.open('get', '/api/filenames', true); + xhr.onload = function () { + var fnames = JSON.parse(xhr.response); + fnames.forEach(function (element) { + $("#filenames").append("<a href=\"./uploads/" + element + "\" style=\"display: block\">" + element + "</a>"); + }); + } + xhr.send(); + } + uploadedFilenameList(); +}); + + |