Open bagwanpankaj opened 3 years ago
@bagwanpankaj Thanks for posting! We'll take a look as soon as possible.
In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.
For help with questions about Sails, click here.
Hi @bagwanpankaj, I'm not sure what sending a file as binary means, but have you tried sending it that way as content-type: multipart/form-data
?
We can not leverage content-type: multipart/form-data
on tool submitting the data. Only supported content-types are application/zip
or application/octets-stream
. But I do not find way in Sails.JS to intercept and save attachment sent as application/zip
@bagwanpankaj I imagine if you're really desperate, you could rewrite the Content-Type
header in middleware before bodyParser
- see middleware.order
in https://sailsjs.com/documentation/reference/configuration/sails-config-http.
Node version: v14.5.0 Sails version (sails): 1.4.0 ORM hook version (sails-hook-orm): 2.1.1 Sockets hook version (sails-hook-sockets): 2.0.0 Organics hook version (sails-hook-organics): NA Grunt hook version (sails-hook-grunt): NA Uploads hook version (sails-hook-uploads): NA DB adapter & version (e.g. sails-mysql@5.55.5): sails-postgresql@1.2.0" Skipper adapter & version (e.g. skipper-s3@5.55.5): NA
We have Sails.JS as backend API server. While getting an attachment with
multipart/form-data
works smoothly usingreq.file
. But when attachment is sent as binary usingContent-Type: application/zip
orContent-Type: application/octet-stream
POST verb, same is not available as parameter, nor found in request object.How to get payload in case of
application/zip
andapplication/octets-stream
content-type