When you send a file with a filename that does not have an extension, the content type of that part is set to "false", which obviously ends in an error when talking to the server.
The problematic part is this line:
header +=
'; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK +
'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path));
mime.lookup returns false, when it can't determine the content type.
Maybe replace by this?
header +=
'; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK +
'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)
|| 'application/octet-stream');
When you send a file with a filename that does not have an extension, the content type of that part is set to "false", which obviously ends in an error when talking to the server.
The problematic part is this line:
mime.lookup returns false, when it can't determine the content type.
Maybe replace by this?