Browse Source

Should work now

master
Carlos Mogas da Silva 2 years ago
parent
commit
4d43fe365d
  1. 5
      default.conf
  2. 5
      share_v2.php

5
default.conf

@ -10,11 +10,10 @@ server {
access_log /dev/stdout;
error_log /dev/stdout info;
location ~ ^\/share_v2.php\/([^\/]+)\/([^\/]+)$ {
location ~ ^\/share_v2.php\/([^\/]+)\/([^\/\?]+)(?:.*)$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/share_v2.php;
fastcgi_param url_p1 $1;
fastcgi_param url_p2 $2;
fastcgi_param UPLOADED_FILENAME $1;
include fastcgi_params;
fastcgi_intercept_errors on;
}

5
share_v2.php

@ -65,7 +65,8 @@ $CONFIG_CHUNK_SIZE = 4096;
/* Do not edit below this line unless you know what you are doing (spoiler: nobody does) */
$upload_file_name = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])+1);
//$upload_file_name = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])+1);
$upload_file_name = $_SERVER['UPLOADED_FILENAME'];
$store_file_name = $CONFIG_STORE_DIR . '/store-' . hash('sha256', $upload_file_name);
$request_method = $_SERVER['REQUEST_METHOD'];
@ -77,7 +78,7 @@ header('Access-Control-Max-Age: 7200');
header('Access-Control-Allow-Origin: *');
if(array_key_exists('v2', $_GET) === TRUE && $request_method === 'PUT') {
error_log(var_export($_SERVER, TRUE) . '\n', 3, '/webroot/debug.txt');
// error_log(var_export($_SERVER, TRUE));
$upload_file_size = $_SERVER['CONTENT_LENGTH'];
$upload_token = $_GET['v2'];

Loading…
Cancel
Save