Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload_pass_form_field does not work #150

Open
anymale opened this issue Jun 20, 2023 · 1 comment · May be fixed by #152
Open

upload_pass_form_field does not work #150

anymale opened this issue Jun 20, 2023 · 1 comment · May be fixed by #152

Comments

@anymale
Copy link

anymale commented Jun 20, 2023

Using this form

<form name="upload" method="POST" enctype="multipart/form-data" action="http://localhost:8009/mptst">
<input type="file" name="file1"><br>
<input type="file" name="file2"><br>
<input type="text" name="txt1">
<input type="submit" name="submit" value="Upload">

I send file(s) with comment but after upload module I do not see anything but file1.* and file2.* fields.

nginx config:

  location @mptst { js_content tst.mptst; }
  location /mptst {
    ### Pass altered request body to this location
    upload_pass         @mptst;

    ### Store files to this directory
    ### The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
    upload_store        /tmp;

    ### Allow uploaded files to be read only by user
    upload_store_access user:r;

    ### Set specified fields in request body
    upload_set_form_field       $upload_field_name.name "$upload_file_name";
    upload_set_form_field       $upload_field_name.type "$upload_content_type";
    upload_set_form_field       $upload_field_name.path "$upload_tmp_path";

    ### Inform backend about hash and size of a file
    upload_aggregate_form_field $upload_field_name.sha1 "$upload_file_sha1";
    upload_aggregate_form_field $upload_field_name.size "$upload_file_size";

    upload_pass_form_field      ".*";

    upload_cleanup      400 404 499 500-505;
  }
@amlan-sw
Copy link

amlan-sw commented Jul 3, 2023

maybe same solution:

#140 (comment)

eduardbareev added a commit to eduardbareev/nginx-upload-module that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants