How would I go about downloading a lua file using openresty

21 views
Skip to first unread message

ElpersonPL

unread,
Jun 27, 2021, 11:49:17 AMJun 27
to openresty-en
I'd want to be able to download a file using lua code but reading using lua might be very bad (especially for large files becaue it'd have to allocate a lot of RAM) so is there a function that can make openresty do it automatically and download the file to the user's PC?

ElpersonPL

unread,
Jun 27, 2021, 11:50:28 AMJun 27
to openresty-en
Edit: *a file not only lua files but files in general

Kshitij Joshi

unread,
Jun 27, 2021, 12:34:27 PMJun 27
to openresty-en
Can you set a response header?
add_header  Content-Disposition  attachment;

Reply all
Reply to author
Forward
0 new messages