# HttpUploadModule - after upload file won't move/rename

**URL:** <https://www.ruby-forum.com/t/httpuploadmodule-after-upload-file-wont-move-rename/235124>\
**Category:** NGINX\
**Created:** [May 31, 2013, 11:50pm UTC](https://www.ruby-forum.com/t/httpuploadmodule-after-upload-file-wont-move-rename/235124 "2013-05-31T23:50:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [May 31, 2013, 11:50pm UTC](https://www.ruby-forum.com/t/httpuploadmodule-after-upload-file-wont-move-rename/235124/1 "2013-05-31T23:50:42Z")

</div>

I’m trying to setup a very simple HTTP POST file upload server. I’m  
trying  
to POST files via curl, without worrying about forms or responses, etc.  
I  
just want to drop the file in nginx, and have it land.

So far, the file uploads into the upload\_store location, but it doesn’t  
move  
out. I’m left with a valid file with a hashed filename, in a hashed  
directory. I feel like I’m missing something simple and obvious, and  
have  
got a bit crosseyed in the process. Here’s my config:

```
    location /data {
            upload_pass /returnok;
            root /opt/datapush/test;
            upload_store /tmp/upload 1;
            upload_store_access user:rw group:rw all:rw;
            upload_set_form_field $upload_field_name.name

```

“$upload\_file\_name”;  
upload\_set\_form\_field $upload\_field\_name.content\_type  
“$upload\_content\_type”;  
upload\_set\_form\_field $upload\_field\_name.path  
“$upload\_tmp\_path”;

```
            upload_cleanup 400 404 499 500-505;

            access_log /mnt/log/nginx/datapush_access.log main;
            error_log /mnt/log/nginx/datapush_error.log debug;
    }
    location /returnok {
            return 200;
    }

```

/opt/datapush/test/data exists, and is 777 (got a little frustrated at  
one  
point). Also, i have debug logging turned on, and everything looks  
good,  
but there is no mention of it trying to rename or move the file, and no  
error to that effect either. Come on, someone show me what I’m over  
looking  
here.

Posted at Nginx Forum:

> **[HttpUploadModule - after upload file won't move/rename](https://forum.nginx.org/read.php?2,239736,239736#msg-239736)**
>
> I'm trying to setup a very simple HTTP POST file upload server. I'm trying to POST files via curl, without worrying about forms or responses, etc. I just want to drop the file in nginx, and have it land. So far, the file uploads into the upload\_store...

---

<div class="post-metadata">

**Author:** ![Homebrewsky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c67d28/32.png) [@Homebrewsky](https://www.ruby-forum.com/u/Homebrewsky)\
**Post date:** [June 1, 2013, 12:06am UTC](https://www.ruby-forum.com/t/httpuploadmodule-after-upload-file-wont-move-rename/235124/2 "2013-06-01T00:06:29Z")

</div>

Hello,

Am 31.05.2013 23:50, schrieb Homebrewsky:

> ```
> upload_pass /returnok;
> upload_cleanup 400 404 499 500-505;
> 
> access_log /mnt/log/nginx/datapush_access.log main;
> error_log /mnt/log/nginx/datapush_error.log debug;
> }
> 
> ```

location /returnok, there you can/must move the file to the final  
destination. Currently there happens nothing, but it keeps in the  
temporary directory because return code 200 is not listed in  
upload\_cleanup…

> ```
> location /returnok {
> return 200;
> }
> 
> ```

Kind regards,

Alexander
