Category: Question and Answers
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Processing blob data url

Issue

I have uploaded a large (.csv) file as blob in Appsmith and now I need to validate column names, but I don't know how to process blob data url in Appsmith. Although I tried setting the Data Format property of the filepicker to CSV, it didn't work. Appsmith does not officially support this feature, but there is a workaround available that has a limitation of local storage limits. I hope that Appsmith will add support for this functionality in the future.

Resolution

Currently, Appsmith does not officially support processing blob data URLs. However, a possible workaround is to use the JavaScript FileReader API to read the blob data and convert it to a usable format. The code example provided in the response involves creating a function that accepts the blob data URL as a parameter and then extracts the file type and URL using a helper function. The readBlob function then reads the blob data using the FileReader API and returns the data in a usable format depending on the file type (Base64, Binary, or Text). The resulting data can then be stored using the storeValue function. It should be noted that this workaround has a limitation in that Appsmith may throw an error due to local storage limits. The documentation has been updated to reflect this issue, and a feature request has been opened to support this functionality in the future.