@otavionestares Thanks, sadly I don’t need to download it client side. I need it downloaded server side. But it looks like Jelle’s extension can help with it.
Regarding this topic: I still believe that ‘get file’ is broken and should allow me to get files to my server using s3
There bug here is that the path needs to be exactly the same as the KEY’s path.
So, before GetFile step, you need to do a create folder step, and create the folder: /school/1/invoices/
Then, in path, just put /.
We used this just last week, and ended up copying Wappler’s code to create a custom module where we could set whatever path we need.
Say I have files on the S3 like /user/patrick/avatar.png and /user/george/avatar.png.
If I save the avatar from patrick to the path /tmp/ it will generate /tmp/user/patrick/avatar.png. It will keep the path which was included in the key. If I then save the avatar from george it will be creating a new file. When we would strip the path the file would be overwritten.
Seeing the error in the topic post it seems that it doesn’t create the needed folders dynamically. Will have a look at that.
Would there be a use-case where the path needs to be stripped and file being saved as /tmp/avatar.png then let me know. I think we should keep the path in and just fix the dynamic folder creation.
For my use case right now I am okay with /tmp/school/1/invoices/invoice.pdf
However, I still would feel like we would have more freedom and flexibility if the code isn’t ‘biased’ in this way.
To save /user/patrick/avatar.png as /tmp/user/patrick/avatar.png I could set it up like this:
Which has the benefits of:
Being more clear for the user (IMO) because there’s no mention of how they key and Path are being joined in the UI right now
More flexibility, because I could also save the files like
I would then remove these files immediately (I download them to send them away again, then remove them from my server). So if for some reason these files aren’t removed and I’m seeing this folder 2 months later… I get more context with my own naming scheme.
If you do keep it the same, I highly recommend some info in the tooltips
What would the create path checkbox exactly do. Would you rather have an error when the path doesn’t exist and the checkbox is not checked? Perhaps better then is to have an option to strip the path from the key.
I feel stripping the path by default is what’s generally expected - an option would be nice but the remote path would generally have little bearing on what I want t do with the file post-download
That’s another way of looking at it. What I meant is in the Path input, whatever path is given, the file should just get downloaded there.
If folders in the given path do not exists, they would need to be created. Which means having “create path” option does not sound right.
So “Strip Key Path” is a better name for it I suppose.