Merge pull request #133 from rplatel/download-arbitrary-url
Allow downloads from arbitrary URLS
This commit is contained in:
commit
7606d25e4b
1 file changed
+12
@@ -322,6 +322,18 @@ this.download = (task, methodResponse, callback) ->
|
||||
return
|
||||
|
||||
if methodResponse.type isnt 'DownloadResponse'
|
||||
if task.url?
|
||||
methodRequest = {
|
||||
type : 'Download',
|
||||
fileType : task.fileType or '1 Firmware Upgrade Image',
|
||||
url : task.url,
|
||||
username: task.username,
|
||||
password: task.password,
|
||||
successUrl : task.successUrl,
|
||||
failureUrl : task.failureUrl
|
||||
}
|
||||
callback(null, STATUS_OK, methodRequest)
|
||||
else
|
||||
db.filesCollection.findOne({_id : mongodb.ObjectID(String(task.file))}, (err, file) ->
|
||||
if not file?
|
||||
callback('File not found')
|
||||
|
||||
Reference in new issue
Block a user