This works, but it saves my uploads with random number names like
0000000001
0000000002 0000000003 0000000004 0000000005 0000000006 0000000007
0045422062 0059512315.
I want to save them with the original name.
Remember, my @test backend is also Nginx and not something else.
I’m not sure you can really do what you want to. The upload module was
not
designed for this purpose. If you want to do this you either need to
modify
the source of the upload module or perhaps you can handle such logic by
using the lua module to script what to do with the file uploads.
This seems odd. If it wasn’t meant for Nginx to process uploaded files,
then
it couldn’t have processed them by itself.
For example, I changed
location @test {
proxy_pass http://example.com:8080;
to
location @test {
default_type text/html;
root /www;
and removed the :8080 server part and it still works.
So I am inclined to think that there must be a way to set the filename
without going to such lenghts as to change the code.
and removed the :8080 server part and it still works.
So I am inclined to think that there must be a way to set the filename
without going to such lenghts as to change the code.
Yes there is, but the default nginx install does not have the features
available to do what you want and the upload module does not introduce
any
such feature either. If you want nginx to be able to rename files based
on
user input then you need a module which introduces that capability into
nginx.
Of course, at this point I’m talking theory only as I haven’t ever done
anything like this, but it should work provided either lua module or
perl
module has the adds the required features - in theory.
On Tue, Aug 28, 2012 at 6:43 AM, Ensiferous [email protected]
wrote:
I’m not sure you can really do what you want to. The upload module was not
designed for this purpose. If you want to do this you either need to modify
the source of the upload module or perhaps you can handle such logic by
using the lua module to script what to do with the file uploads.
Yes! There’s a lua-resty-upload library for ngx_lua that can do
non-buffered uploading:
https://github.com/agentzh/lua-resty-upload
You don’t have to touch the disk at all if you prefer sending the data
chunks to the TCP/UDP backends (via cosockets) in a strict
non-buffered mode.
Best regards,
-agentzh
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.