I'm using the S3 File Uploader as template. The file upload is somewhat unsuccessful:
When I use the single file upload button that comes with the template it successfully uploads my csv files. It also shows the correct preview in the preview window.
BUT when I use a multi file upload, as described here Upload multiple files to Google Cloud Store or Amazon S3 | Retool Docs , it uploads a file with some kind of nonsense data. (see screenshot) Even when I only upload one file through that functionality, it returns the same result.
Yes I'm trying to upload csv files! The preview section isn't the problem, that preview section is displaying accurately the contents of the file. The problem is that the file itself is not being uploaded correctly, it somehow corrupts the file during upload. When I download the file, either through the retool download button or directly from the AWS console, and open the file I see the exact same content that the preview section shows. The file somehow gets corrupted?
Got it! It looks like you're setting "CSV" as the type in your upload query when you might actually want to use "Binary" and pass in the base64 data from the uploaded CSV.
That solved one problem but created a new one
It now uploads the file without corrupting it, yay! When I download the file, both through the download button on the retool dashboard or the s3 bucket directly, I have a correct csv file with the data I expect it to have.
The new problem is that the preview window cannot display it correctly anymore. It says the file type is binary/octet-stream instead of csv. I added another clause in the fileType script to handle anything of that type the way csv types are handled but then it only shows an empty table:
I do have questions about that post (e.g. numbro only does formatting but doesn't decode anything?) but I think I'll just omit the file preview for now. Having a functional multi file upload option is more important and that works now! Many thanks @victoria