Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

$upload_file_name is null


  • To: nginx-ru@xxxxxxxxx
  • Subject: $upload_file_name is null
  • From: "Megha" <nginx-forum@xxxxxxxx>
  • Date: Thu, 18 Oct 2012 05:45:45 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tigger.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=xgivjc9fhRaQZoGd5rdkDPPYfC7Pk9Nn/60U4uqjGlI=; b=vUlr7brLome5JWr3HDSG5/H20jygimIa+AJ1JKE9XhQOCBHjThlT/kFyyzU9ZditY7wtqR6gJuY1Lo2YAlxy7PrD8sHUnzfDeXpCGKR4TW+ZNrm5TnxzRP7GrhGYcCDk;

Hi,

I am trying to upload file from client(simple HTML multipart post request)
to my Nginx server.
I can upload the file on Nginx server successfully but  $upload_file_name is
null. I am using Nginx log mechanisam to
see the value as below:-

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"'
                      ' ** "$upload_file_name"  **';

My Nginx conf file:

location /upload {

        # Pass altered request body to this location
        upload_pass   @test;

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

        # Allow uploaded files to be read only by user
        upload_store_access user:rw group:r all: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.content_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.md5"
"$upload_file_md5";
        upload_aggregate_form_field "$upload_field_name.size"
"$upload_file_size";

        upload_pass_form_field "^submit$|^description$";
        upload_cleanup 400 404 499 500-505;

HTML page:

<html>
    <head>
        <title>Test Server</title>
        <script src="http://code.jquery.com/jquery.min.js";></script>
    </head>
    <body>
        <form id="upload-form" method="post" target="upload_target"
enctype="multipart/form-data" action="/upload">
            <input name="file" id="file" size="27" type="file" /><br />
            <input type="submit" name="action" value="Upload" /><br />
            <iframe id="upload_target" name="upload_target" src=""
style="width:100%;height:100px;border:0px solid #fff;"></iframe>
        </form>
    </body>
</html>

Am I missing here something or do I need to add some extra code here to get
values of $upload_file_name, "$upload_content_type" etc ? Or do I need to
modify my client code ?

Thank you.
M

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,231955,231955#msg-231955

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.