Php apache_request_headers() replicement?

I’m developing a xhr uploading script by using

But nginx has no apache_request_headers function, and find from

function apache_request_headers() {
foreach($SERVER as $key=>$value) {
if (substr($key,0,5)=="HTTP
") {
$key=str_replace(" “,”-",ucwords(strtolower(str_replace("
return $out;

my problem is that upload script has following function that needs a
content-lenght param which nginx does not have

function getSize(){
$headers = apache_request_headers();
return (int)$headers[‘Content-Length’];

so I add an extra param to my site config

fastcgi_param CONTENT-LENGTH $content_length;

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…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs