diff --git a/app/network/network.js b/app/network/network.js index 1a5aa26696..49d4e1bf5a 100644 --- a/app/network/network.js +++ b/app/network/network.js @@ -398,9 +398,14 @@ export function _actuallySend ( const {size} = fs.statSync(renderedRequest.body.fileName); const fileName = renderedRequest.body.fileName || ''; const fd = fs.openSync(fileName, 'r+'); + setOpt(Curl.option.INFILESIZE, size); setOpt(Curl.option.UPLOAD, 1); setOpt(Curl.option.READDATA, fd); + + // We need this, otherwise curl will send it as a POST + setOpt(Curl.option.CUSTOMREQUEST, renderedRequest.method); + const fn = () => fs.closeSync(fd); curl.on('end', fn); curl.on('error', fn);