<span class="Apple-style-span" style="font-family: Arial; font-size: medium; ">Hello,<br style="clear: both; ">I&#39;m developing a xhr uploading script by using <a href="http://github.com/valums/file-uploader" target="_blank" rel="nofollow" style="color: rgb(53, 95, 53); ">http://github.com/valums/file-uploader</a><br style="clear: both; ">

But nginx has no apache_request_headers function, and find from <a href="http://php.net">php.net</a> an replicement.<br style="clear: both; "><pre class="bbcode" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(196, 198, 162); border-right-color: rgb(196, 198, 162); border-bottom-color: rgb(196, 198, 162); border-left-color: rgb(196, 198, 162); background-color: rgb(254, 255, 236); padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px; overflow-x: auto; overflow-y: auto; ">

function _apache_request_headers() { 
        foreach($_SERVER as $key=&gt;$value) { 
                if (substr($key,0,5)==&quot;HTTP_&quot;) { 
                        $key=str_replace(&quot; &quot;,&quot;-&quot;,ucwords(strtolower(str_replace(&quot;_&quot;,&quot; &quot;,substr($key,5))))); 
                        $out[$key]=$value; 
                }
        } 
        return $out; 
}</pre>my problem is that upload script has following function that needs a content-lenght param which nginx does not have<br style="clear: both; "><pre class="bbcode" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(196, 198, 162); border-right-color: rgb(196, 198, 162); border-bottom-color: rgb(196, 198, 162); border-left-color: rgb(196, 198, 162); background-color: rgb(254, 255, 236); padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px; overflow-x: auto; overflow-y: auto; ">

function getSize(){
        $headers = <b>apache_request_headers</b>();
        return (int)<b>$headers[&#39;Content-Length&#39;]</b>;
}</pre><br style="clear: both; ">so I add an extra param to my site config<br style="clear: both; "><br style="clear: both; "><pre class="bbcode" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(196, 198, 162); border-right-color: rgb(196, 198, 162); border-bottom-color: rgb(196, 198, 162); border-left-color: rgb(196, 198, 162); background-color: rgb(254, 255, 236); padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px; overflow-x: auto; overflow-y: auto; ">

fastcgi_param CONTENT-LENGTH $content_length;</pre><br style="clear: both; "><br style="clear: both; ">this parameter is needed for how much bytes uploaded to the server (maybe I get it wrong) , how can I fix this issue? Thanks for all..</span><div>

<font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-size: medium;"><br clear="all"></span></font>--<br>Hüseyin Mert<br><a href="http://www.hmert.com">http://www.hmert.com</a><br>
</div>