How would I go about downloading a lua file using openresty

55 views
Skip to first unread message

ElpersonPL

unread,
Jun 27, 2021, 11:49:17 AM6/27/21
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 AM6/27/21
to openresty-en
Edit: *a file not only lua files but files in general

Kshitij Joshi

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

Reply all
Reply to author
Forward
0 new messages