A
A
Artem2019-12-04 16:05:18
Nginx
Artem, 2019-12-04 16:05:18

How can I submit a file to nginx?

I'm trying to send a file, via nginx:

ngx.req.set_header("Content-Disposition", "attachment; filename=qwe.txt")
ngx.say('{"code":"101","message":"empty token"}')

But when you click on the link, the page opens, and the file is not downloaded

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2019-12-04
@artemsh5432

ngx.req.set_header changes the request header, which is pretty pointless.
You need https://github.com/openresty/lua-nginx-module#ngxh...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question