RELEASED - plugin JS Zip file generator

Hi!
I did not tried, but maybe you can add foldername/filename.ext to the filename
So you may need to set something in your workflow when file is uploaded to have the full folder/file.ext so you can use this in the filename list.

Thanks! Will try and report back :slight_smile:

1 Like

I confirm this work @oh.devteam
https://sandboxjc.bubbleapps.io/version-test/zip
editor: Sandboxjc | Bubble Editor

1 Like

hey @Jici did test also and itā€™s perfectly working, thanks!

This rises a new question: itā€™s possible to create mixed expressions (static and dynamic) so that I can create dynamic filenames with complex expressions without the necessity to create/modify a custom field reserved for folder management?
For example: ā€œdynamic expression for folder name/dynamic expression for file nameā€

I hope to have explained myself correctly :sweat_smile:

@oh.devteam Not directly in the plugin. You need to provide two list. If you can do that using another option (maybe list shifter), itā€™s up to you. I think the DB option is an easy one but you might have a specific case that will request a different way :wink:

1 Like

Thanks for the ideas! Yes, Iā€™ll check it out with listshifter, this will probably solve the question.

Thanks so much again :slight_smile:

1 Like

Hello @Jici

When the list is large (in my case 300 items) the action block the browser for two or three minutes before even firing the progress bar. Is this something normal or am I doing something wrong ?
Maybe is the ā€œSearch forā€

Thanks in advance

This is a client side script. So itā€™s possible with large number of item the browser get stuck while processing the first part of the WF to get all files (and probably also affected by do a search for). I suggest you to test by setting a on page load to load the list of term period data into a state. And trigger the WF Generate a zip using the state instead. I actually donā€™t have a very large number of file in my DB so it will be hard for me to test. So if you can test this, let me know if the WF block the browser or itā€™s just the do a search that do that :wink:

You can send me a PM and I can help you setting this.

I could consider adding a server side action instead but thereā€™s actually already plugin that do it on server side.

Thank @Jici for your quick reply.
By the way the plugin works like charm under 100 items :slight_smile:

However even with a custom state list it still blocks the browser for larger lists. It would be super nice if we could have the backend option for large lists.

I couldnā€™t find the plugin that download in zip file serverside.

Thanks for your help

Seem that the one that was working on server side is not available anymore.
I will work on adding a server side option this week.

1 Like

Reminder
Be sure that file you are requesting are not private and exist. If you get an error like:

The plugin JS Zip / action Generate Zip file a JSZip threw the following error: Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://...

Most of the time this is because you are requesting a deleted file in AWS (but not in your DB) or a private file

The next week I will release a new version with a server side action to zip file that will allow you to use your API key to zip a private file :slight_smile:

I will also consider an url checker to remove any url that return an error (40X) to avoid this issue. They should be listed in a new state

1 Like

Wow it would be so nice !! Thanks @Jici

Hey, @Jici,

First of all, great plugin

Do you mean I can enter the download percentage in a progress bar?

Another thing, I donā€™t know if this can be achieved:

  • I have a Type called ā€œHousesā€ and another called ā€œFileā€.

  • ā€œHousesā€ has 2 fields ā€œNameā€ (text) and ā€œFilesā€ (list of "FIles). And ā€œFileā€ has 2 fields ā€œFileā€ (file) and ā€œNameā€ (text).

  • I need to have a button to download all houses with all the files.

  • The downloaded file should be a ZIP with folders inside. Each folderĀ“s name should be the"Name" (text) of each ā€œHouseā€ and inside all the files with file name ā€œNameā€ (text) of each file.

Is this be possible?

Thanks in advance :slightly_smiling_face: :computer:

Hi @hacker
Thanks :wink:
You can use progress bar with progression state yes. this is exactly what I do on the demo page.
For your question with folder, I think itā€™s possible.
The complexity is more related to the list of files that are related to a single item that contain the folder name. If you also store the house name at file level, it would be easier.
What I think is that you will need to:
File list url = Do a search for filesā€™file
File name = Do a search for files:format as text:extract with regex
In the format as text, content to show per item, Do a search for house where ā€œFilesā€ containt this files:first itemā€™s name / (manually write /) This fileā€™s name
Delimiter |
And in the extract with regex, use: [^|]+

1 Like

Great, thanks, @Jici

1 Like

@Jici

Hello Jean Claude!

Can you please explain what this limit is? ā€¦ is it 50 MB?

Hi @cmarchan I may need to test but it was before Bubble raise the max size of file. Before this was limited to 50 mo. I think itā€™s now 5GB but I didnā€™t test with a large file size. This is a client side (for now, working on a server version too). So actually, you donā€™t need to save it to Bubble. You can let client directly save the zip file

@Jici

Thanks!

Please reconfirm what mo means

mb :stuck_out_tongue: mo (mo is more french :wink:

1 Like

@jici

Thanks!!

And please do share when you get to test

What would be the max file size that can be compressed using the client? ā€¦ ball park