Skip to content

Commit

Permalink
https://github.com/danwrong/restler/issues/250
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jedich committed Mar 4, 2018
1 parent b261064 commit f7d1554
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/multipartform.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ Part.prototype = {

//Now write out the body of the Part
if (this.value instanceof File) {
fs.open(this.value.path, 'r+', function (err, fd) {
fs.openSync(this.value.path, 'r+', function (err, fd) {
var stats = fs.fstatSync(fd);
var bufferSize = stats.size
var bufferSize = stats.size;
if (err) throw err;
var chunkSize = 512;
var position = 0;
Expand All @@ -129,7 +129,9 @@ Part.prototype = {
else {
stream.write("\r\n");
callback();
fs.close(fd);
fs.close(fd, function(err) {
callback(err);
});
}
});
})(); // reader()
Expand Down

0 comments on commit f7d1554

Please sign in to comment.