Expected behavior
As described in the documentation, it’s possible to download a file on a smart action response using the POST Http verb :
https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#downloading-a-file
Actual behavior
Try to create a smart action as described in the documentation:
https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#downloading-a-file
It is important to use a Smart Action with POST and not GET.
When you call your smart action, the server returns an HTTP response containing a valid response with the file attached.
But, the FrontAdmin interface tries to parse into JSON the body in the HTTP response. Obviously, is not parsable, and the interface display an error message.
There is a “workaround”, if you switch your Smart action in GET. It works, but you don’t have the input parameters …
Failure Logs
Please include any relevant log snippets, if necessary.
Context
Please provide any relevant information about your setup.
- Package Version: tested on 6.6.2 and 5.7.0
- Express Version: 4.17.1
- Sequelize Version: 5.22.3
- Database Dialect: Postgres
- Database Version: 11
- Project Name: Swan Back-Office