I’m stuck at trying to add an array of files (images) to a single zip file on the server side (PHP) - all I get is the first file from either a repeat action or its original database query:
Hi.
Passing an array of file paths should work. Has been some time since I last used it.
The binding looks weird in the screenshot shared.
Maybe try passing a simple array containing just path of files.
How would you suggest building the array? Considering the output of the ‘user_images’ query needs modifying to match the path of the file (it needs appending ‘/user_data/’) - the input is accepted by the Files to Zip module, but obviously the database query is missing that appended data.
Thanks @sid, that’s very valuable advice. I now have an array that returns the correct values: {"test":["\/user_data\/EBDCE817-CA07-4B9A-A8BB-C16D28D4E4D1.jpg","\/user_data\/D5E72921-F486-48BF-A353-CA53EA837910.jpeg"]}
however, I get an incorrect path from the Files to Zip output, I believe it may be because of the added slashes, an issue I’ve already been stuck with here.
Interesting.
Assuming that the path stored in DB is something like /user_data/EBD...., try replacing the slashes in the custom query as well. Replace \ with /.
Although, this might cause an issue when switching between Linux/Windows environment.
It seems the added slashes are added after the output of the query, within Wappler’s Json. @patrick, @Teodor, would you have any suggestions? This seems to be a setting within json_encode.