Plugin request a url and save a file in the database

Hi all,
Hope everybody doing well !

I’m trying to create my first plugin and it’s not easy for me !
Firstly my code work on my sdk but the hard thing for me it’s get my code work on bubble !

My pluging send a request to a website to get data and put it in a file then this file should be save in the database ! So the first part is done, but i still don’t understant how to inject my file in my database with the plugin editor.
Bellow you can see how i do that, i’m still beginner on bubble It’s quiete hard to find a tutorial.

There is something I don’t understand. How should I connect my database to my pluggin ? Where is connection ?

Thank you and have a good day !

I don’t think you can access fs.. I think you would have to create a blob and return that. It’s then up to the user save it to the database.

What I used to do to learn is take another plugin that has a similar functionality and learn from it.

Hey there.

You can’t access the file system from server side actions. That means you cannot read or write files from here. What you can do is generate a file as a Data URI (it’s basically files as text) but that adds 30% to your file size. If it’s a basic file like .txt or .csv then you can just return the file as a string in that case, that won’t increase the file size.

Thank you for you answer Indeed you can’t access to the fs unfortunetely .

Yes I tried to take another plugin but it seem different and that didn’t help me.

Thank you Jonah !

Yep It’s juste texte (whatever .txt, .csv or other extension) and a just need to send me that data by mail after all…

Isn’t there a character limit for as string in bubble ? Mines could be very long :confused:

Yes you’re correct, there is a 6MB limit (which really sucks). I’ve brought this up with some higher ups on the bubble plugin team before, they’re aware of the limits of what plugins can do:

  • 6MB maximum
  • 30 second time limit

Their response to me was to just do the work on the client side…

You can convert the file into base64 and upload it on BUbble server-

Here is how you can upload the base64 to Bubble server- How to upload Base64 data in server side Bubble plugin action?

Okay ! So I don’t think it will be enought for me :confused:
I’ll try to convert into base 64 and upload it !

Thank you ! I will be back when it work to give news !

Thank you ! I’ll try to do that this afternoon.

1 Like

It’s a shame the only way to do it is by uploading files via post request

1 Like

Yes I agree. Is there a way to report that to bubble ?

Hi everbody !

I worked on my project ! It’s better now but i met a new issue. I got this answer now :

Plugin action Myplugin (testing) error when parsing the response:
the key message is not part of the btype definition

My fonction return that :

                return `${userId}/status/${tweetId}`;

then I use the fonction “JSON.stringify”.

But still the same problem, have you an idea ?