/getfile_action |
this action tries to get a file with the given name
if it finds it, it increases the request-counter of this file
sets the appropriate mimetype and redirects the browser to the file |
Sourcecode in Site/actions.js:
1: function getfile_action() { 2: var f = this.files.get(req.data.name); 3: if (f) { 4: f.requestcnt++; 5: res.contentType = f.mimetype; 6: res.redirect(f.getUrl()); 7: } else { 8: res.message = getMessage("error.fileNotFound", req.data.name); 9: res.redirect(this.href()); 10: } 11: return; 12: } |