0

I have set the following configuration:

 location /upl {
       root /storage/www/upl/data;
       client_body_temp_path   /storage/www/upl/client_tmp;

       dav_methods  PUT DELETE MKCOL COPY MOVE;

       create_full_put_path   on;
       dav_access             group:rw  all:r;
  }

I upload a file with: curl -T test.txt http://x.xx.xx.xx:8080/upl

All of my files end up in data folder but all files have the same name "upl" the same as the location ?! Why :S

Please help

BR,

3
  • 2
    Because upl is the filename you specified. Mar 10, 2021 at 22:14
  • @MichaelHampton what do you mean ? Where did i say that? I am uploading test.txt
    – Lonko
    Mar 11, 2021 at 8:32
  • You used PUT. The filename the server uses is the URL path. Mar 11, 2021 at 19:07

2 Answers 2

5

You can do this by specifying filename into URL, without using any external module :

location ~ "/upl/([0-9a-zA-Z-.]*)$" {
        alias     /storage/www/upl/$1;
        client_body_temp_path  /tmp/upl_tmp;
        dav_methods  PUT DELETE MKCOL COPY MOVE;
        create_full_put_path   on;
        dav_access             group:rw  all:r;
}

And use : curl -T test.txt http://x.xx.xx.xx:8080/upl/text.txt

0

According to Wikipedia, Nginx has a very limited optional WebDAV module and a third-party module, the ngx_http_dav_module.

Servers & Clients Supported

https://en.wikipedia.org/wiki/WebDAV

1
  • Thank you, found this also but don't think it applies as it is using proxypass for some backend. I don't have a backend i would like to have a normal http put file
    – Lonko
    Mar 10, 2021 at 15:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .