Forum Discussion
ASM Blocking Image Uploads
Hello
We have a Rest API using JSON which accepts an image as part of the payload. The image is Base64 Encoded and generally works well however we have had some instances where the Base64 encoding contains a string that the ASM believes is an attack and blocks the payload. I have on a couple of these disabled the signature on the specific JSON profile however I would prefer not to have to do this. I was thinking of asking our Developers to consider a change to the API to accept the image as a file upload rather than Base64 Encoding it into the JSON payload. We control both the Client and Server side of the connection so I do not have to wait for clients to make changes to the API. There is also a self diagnostic Rest Service that takes debug information in and this too also experiences blocks on occasions, again I was thinking this too should be a file upload rather than a post of JSON formatted (the JSON is not always very well formatted due to the data within).
Has anyone got any other suggestions that would help resolve this in a more simplistic way.
James
- TortiAltostratus
The best way to do this is with multipart content type. There exist different subtypes, i.e. related or mixed. In my opinion, it is the best way to transport files. Here, you don't need base64. The file can be apend at the rest request without convert it before.
You can look here http://stackoverflow.com/questions/4083702/posting-a-file-and-data-to-restful-webservice-as-json
or http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com