New Download File Server Action for PHP does not work

======== 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

Maybe I don’t see if but what exactly doesn’t work?

no download. I have the exact same Server Action on a NodeJS project and the download works there. No Errors.

So it doesn’t work in the browser? Any errors?

I tested with opening the Server Action directly in the browser:

image

Could you reproduce it?

So what does your browser do? Does it open?
Could you check the devtools in the browser? If there are any errors there?

I will send you the link in a private message

Maybe check the output option? To return a result as it doesn’t return now anything

I already tried that. I get

{"":null}

in the browser.

Here an update for the s3 download file action. Unzip it in dmxConnectLib/modules

s3.zip (1.6 KB)

1 Like

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 :slight_smile:

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?

ah, need to filter out the filename from the key, will post an update here soon for that.

1 Like

Updated file.

s3.zip (1.6 KB)

1 Like

Thank you @patrick! It is working perfectly now.

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 :

image

If I use the direct link to the download route it doesn’t do this. Could you please check this?

I found a workaround. If you use the download component you have to define the filename.

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

Thank you @patrick for your quick fix. Now I get a UTF8 problem in the file
image