Multiple file uploads, the headaches....and most of the solution.

There are several problems within flutterflow with uploading files to firebase. 1.       The file type is restricted to PDF's images audio and video. What if you want a Word document? 2.       You can only upload these restricted files one at a time and know exactly where flutterflow/firebase put them. If you upload multiple images, it doesn't return the URL of where they are, which is unhelpful because in database terms they are for all intents and purposes completely lost. 3.       It renames the document so it may have been called something useful at the beginning, but you don't know what it's called at the end. A photo “my boat in Florida Keys.jpg” ends up as HhDgbmk&knFvkKhFnJf.jpg. It does not store the original name.    However, flutterflow recently added some documentation here.  https://docs.flutterflow.io/actions/actions/ui-interactions/upload-media It didn't work at first, but today I think it does.  Thank you KriNo of FF for pushing the devs to make it work. If you read it, the idea is that you move the files you want to upload into what they are calling the local state, and from there using an API to upload that to firebase. They don't tell you how to write the API, they just tell you that it should return in Json format the URL's of the uploaded files to avoid the problem discussed, of simply not knowing where they are anymore. The solution I've come up with is to write the server to do the file upload, and I've used googles app engine which sits right bang next to firebase and firestore in your box of tools and toys. I'm fully aware that the implementation of this is going to be well beyond that of a no-coder. But until flutterflow write the code for multiple file upload, this I think is your only solution. [image.png][image.png][image.png][image.png][image.png] I know that the following screenshot will not give you much insight in how to set up an upload server on Google's app engine, but it will give you a clue as to what it entails. VSCode for one. For anybody who has created Google cloud function, it's incredibly similar. The only thing is this has a couple of directories below it, so I just can't copy and paste the code here otherwise I would. But I would be available in helping anyone who wants to set up an upload server and try and master the restrictions within flutterflow that exist when it comes to multiple image upload. [image.png] [image.png] So basically this code set up correctly will create a server that will be listening on a certain URL and certain port to have images sent to it.  It will accept the uploads, many at a time, save them to a bucket, give them the correct mime (even word, excel and others  - firebase does that), save the original name in firebase, along with the file size and url.  I have an untested Cloud function to download the file again and rename it back to its original name. Now we have Dropbox/ Google Drive kind of storage in FF.  It sits there it listens and I've had it running for three weeks and so far it has never gone down. The beauty of it is that if you are thinking of some serious document management, Google will automatically scale this up for you, and up to an incredibly high number of calls to it, thousands a month, they don't even charge for it. Everything is easy-ish ..... except the server. PM me if you want me to send you the zip file.

1
5 replies