L
L
luckyredhot2013-07-17 15:27:57
PHP
luckyredhot, 2013-07-17 15:27:57

Stream file upload via nginx (no buffering)

Hello, Khabrovites!

There was a need to do the following task: organize the download of files through nginx in such a way that it initially starts writing the file to the desired folder without using buffering and a temporary folder.

I understand that this is not safe, but for this task it is not important.
The PHP backend needs to be able to work with the files as soon as they start downloading.

Thanks in advance for your help!

PS Something similar was implemented using HAProxy , there is still hope for tengine , but I haven't seen any guaranteed stable solutions yet.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Kravchuk, 2013-07-17
@WhiteD

The option is not the best, but you can send a POST request to the program for processing. The program can be a php script. In it, you can already process the request itself (in its raw form) and write the file where necessary and even update the status in the database, memcache or somewhere else.

K
kenny_opennix, 2013-07-23
@kenny_opennix

webdav is not suitable?

R
ragus, 2013-08-22
@ragus

The built-in ngx_lua will save you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question