## Description If we use REST API action and file picker widget to upload any multimedia files (image, audio, video, pdf, xlsx), The file upload would be successful but file would get corrupted upon uploading. This was happening because file picker widget encodes this file to base64 format, and we were uploading this same base64 string using REST API url. Instead we should have decoded this base64 and then uploaded the file to retain the original contents of the file. This PR fixes that issue by adding a new tab in body of the REST API action called `binary`, once we select this tab, we get autogenerated header for `Content-Type: application/octet-stream`, in this binary input field we can then provide base64 encoded file contents, the server then decodes the contents before triggering the respective REST API and uploading the file. ### Steps to test the issue 1. Add a file picker widget on canvas 2. Select data format as `Base64` 3. Upload any of pdf, image, audio, video, xlsx in file picker 4. Create a REST API action using [Dropbox upload API](https://www.dropbox.com/developers/documentation/http/documentation#files-upload) 5. Configure the API headers as mentioned in the documentation, also configure file name in the header correctly 6. Go to body tab, select binary and file contents in input box using binding like {{Filepicker1.files[0].data}} 7. Execute this API 8. Now go to your dropbox account and check the uploaded file, you should be able to successfully preview it Fixes #32378 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Datasource" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8844375718> > Commit: 3316290a4d7d77ae3f9d8969245c5f470ef1ab5c > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8844375718&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for binary file uploads in API requests, including handling of base64-encoded files. - Expanded content type options to include a new "BINARY" type for API requests. - **Tests** - Implemented new tests to verify the functionality of binary file uploads with dynamic data binding. - **Bug Fixes** - Ensured correct handling and auto-generation of headers for binary file types and form urlencoded data formats. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”> |
||
|---|---|---|
| .. | ||
| .run | ||
| appsmith-git | ||
| appsmith-interfaces | ||
| appsmith-plugins | ||
| appsmith-server | ||
| envs | ||
| mongo-seed | ||
| reactive-caching | ||
| scripts | ||
| .gitignore | ||
| build.sh | ||
| buildpack-run.sh | ||
| docker-compose.yml | ||
| pom.xml | ||
| Procfile | ||
| README.md | ||
| system.properties | ||
Appsmith Server
This is the server-side repository for the Appsmith framework.
For details on setting up your development machine, please refer to this Setup Guide.