MH2ag
February 12, 2021, 8:17am
1
======== TEMPLATE BUG FORM ========
Wappler Version : 3.7.6
Operating System : macOS Big Sur
Server Model: PHP
Database Type: MySQL
Hosting Type: Own Server
Expected behavior
What do you think should happen?
Download from S3 should work (like in NodeJS)
Actual behavior
What actually happens?
Download does not work on opening the Server Action in the browser
How to reproduce
Detail a step by step guide to reproduce the issue
A screenshot or short video indicating the problem
A copy of your code would help. Include: JS, HTML.
Test your steps on a clean page to see if you still have an issue
George
February 12, 2021, 8:28am
2
Maybe I don’t see if but what exactly doesn’t work?
MH2ag
February 12, 2021, 8:29am
3
no download. I have the exact same Server Action on a NodeJS project and the download works there. No Errors.
George
February 12, 2021, 8:30am
4
So it doesn’t work in the browser? Any errors?
MH2ag
February 12, 2021, 8:33am
5
I tested with opening the Server Action directly in the browser:
George
February 12, 2021, 8:57am
7
So what does your browser do? Does it open?
Could you check the devtools in the browser? If there are any errors there?
MH2ag
February 12, 2021, 9:00am
8
I will send you the link in a private message
George
February 12, 2021, 9:04am
10
Maybe check the output option? To return a result as it doesn’t return now anything
MH2ag
February 12, 2021, 9:05am
11
I already tried that. I get
{"":null}
in the browser.
patrick
February 12, 2021, 10:29am
12
Here an update for the s3 download file action. Unzip it in dmxConnectLib/modules
s3.zip (1.6 KB)
1 Like
MH2ag
February 12, 2021, 10:43am
13
Thanks a lot for the update! I can confirm that it is working now.
I now have another problem. If the filename is not equal to the key, the filename is set to the keyname on download. I hope it makes sense
Filename: test.pdf
Key: 3538D42E-1736-4302-979C-6F88835AC63F/52CF4E74-BC35-4E6D-A24E-42CF0057822C/test.pdf
Filename after download:
3538D42E-1736-4302-979C-6F88835AC63F_52CF4E74-BC35-4E6D-A24E-42CF0057822C_test.pdf
Any idea how to solve this?
patrick
February 12, 2021, 10:52am
14
ah, need to filter out the filename from the key, will post an update here soon for that.
1 Like
MH2ag
February 12, 2021, 1:35pm
16
Thank you @patrick ! It is working perfectly now.
MH2ag
February 12, 2021, 2:31pm
17
I’m really sorry to have another question about this topic. I experimented a little bit with the download component and the new Server Action Download File from S3 (PHP Version).
If I use the download component it downloads the file, but the filename is in quotation marks (Safari):
In Chrome I get underscores :
If I use the direct link to the download route it doesn’t do this. Could you please check this?
MH2ag
February 12, 2021, 2:58pm
18
I found a workaround. If you use the download component you have to define the filename.
patrick
February 12, 2021, 3:07pm
19
Seems there is a bug in the download component when the content-disposition header has a filename enclosed in quotes. Here an update.
dmxDownload.zip (1.2 KB)
1 Like
MH2ag
February 12, 2021, 3:16pm
20
Thank you @patrick for your quick fix. Now I get a UTF8 problem in the file