Hi there @teodor…
I have a server action report_activity.php
which does an Export CSV File function:
Where
attendee_list_url = 'file_downloads/activity-report-test-1-report-attendees.csv'
It correctly creates the csv file in my file_downloads
directory.
When this server action completes, it runs the following dmx-download
:
<dmx-download id="report_activity_attendee_list_download"
dmx-bind:filename="report_activity.data.attendee_list_filename"
dmx-bind:url="report_activity.data.attendee_list_url">
</dmx-download>
Where these are the values being used:
report_activity.data.attendee_list_filename = 'activity-report-test-1-report-attendees.csv'
report_activity.data.attendee_list_url = 'file_downloads/activity-report-test-1-report-attendees.csv'
However the file that is downloaded from the browser is the page’s HTML source code, not the .csv file.
This is being executed from my index.php file with a file structure like this:
site_root
index.php
file_downloads/
activity-report-test-1-report-attendees.csv
I’ve used this method before in another part of my app and all has worked well… what am I doing wrong here?
Best wishes,
Antony.