[nginx module] Save response into temp file
hungnguyen
nginx-forum at nginx.us
Thu Oct 9 11:10:31 UTC 2014
Hello,
Sorry for my late replay. Now I can be able to write file into disk and read
from it without problem (csv file) by using this:
ngx_temp_file_t *tf;
tf = ngx_pcalloc(r->pool, sizeof (ngx_temp_file_t));
tf->file.fd = NGX_INVALID_FILE;
tf->file.log = nlog;
tf->path = clcf->client_body_temp_path;
tf->pool = r->pool;
tf->persistent = 1;
rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
tf->persistent, tf->clean, tf->access);
//ngx_write_chain_to_file(&tf->file, bucket->first,
bucket->content_length, r->pool);
ngx_write_chain_to_temp_file(tf, bucket->first);
I set persistent to 1 and I can read from it.
The problem is after reading file and processing it, I have to delete file
manually.
How can file can be delete automatically just after sending nginx's chain to
next filter.
Other question: I write chain into file in order to read from it again. is
it possible to use nginx's chain as a file buffer?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,253477,253863#msg-253863
More information about the nginx
mailing list