chungchunwang / Budibase-File-Upload

Upload files in your Budibase app!
MIT License
22 stars 11 forks source link

File Upload #17

Closed Athik321 closed 3 months ago

Athik321 commented 3 months ago

The data being stored is very long; can I shorten it? I am using the MySQL database. And where was the uploaded image stored?

chungchunwang commented 3 months ago

The uploaded image/file is stored in the data string - that is why it is so long. Thus, you also cannot shorten the data string.

If you're searching for a solution that stores a file/image in a separate store, look into the default Budibase attachment component. https://docs.budibase.com/docs/attachment. That uploads the file to MinIO and stores a link to the file.

Hope this helps!

Feel free to reopen the issue btw if you have any other questions.

Athik321 commented 3 months ago

Actually, I am using a MySQL database, and in a form when I use a table from MySQL, can I also use MinIO in the same form?

chungchunwang commented 3 months ago

Budibase comes with MinIO installed, thus, the file is stored on whatever server is hosting your Budibase app. When you submit a form with the attachment field, it is first stored in MinIO. Then, a url to the file in MinIO is saved to your MySQL.

I made this plugin as using MinIO made it hard to back things up, so this plugin serializes the entire file as a string and saves it into the SQL server.

Athik321 commented 3 months ago

When I create a table and want to add an attachment column, the attachment data type is not visible in the data type list. Do I need to set up MinIO first to make attachment data type visible?

chungchunwang commented 3 months ago

Hmm, I'm not sure as I've only used the native attachment component with the Budibase internal DB. Maybe try asking in the discussion board of the Budibase repo? https://github.com/Budibase/budibase/discussions