form-data: GraphicsMagick Steams Failing?
I am having trouble getting node-gm streams to be accepted by form-data, for example the following code:
gm('somefilepath.png')
.resize(100, 100)
.noProfile()
.stream(function(err, stdout, stderr) {
form = new FormData()
form.append('file', stdout)
form.submit('http://foo')
})
fails with an error
events.js:71
throw arguments[1]; // Unhandled 'error' event
^
Error: Parse Error
at Socket.socketOnData (http.js:1367:20)
at TCP.onread (net.js:403:27)
Note that file streams work no problem with form-data, but i just can’t get the GM stream. Thoughts?
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 44 (21 by maintainers)
Commits related to this issue
- #29 Added custom filename and content-type options to support identity-less streams. — committed to alexindigo/form-data by alexindigo 11 years ago
Just stumbled across this when I thought I was going to lose my mind. Probably not too helpful to you two at this point but if some weary traveller finds this thread, adding the filetype solved my issue: