From: s-ko Date: Wed, 15 Oct 2014 20:37:27 +0000 (+0100) Subject: Manual URL and debug setting X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a9a0cc1c04c2e6f2b3adad2f111d55847f77cc92;p=simple-upload.git Manual URL and debug setting --- diff --git a/index.php b/index.php index b94b8fb..9e0208b 100644 --- a/index.php +++ b/index.php @@ -46,7 +46,10 @@ random_name_alphabet => 'qazwsxedcrfvtgbyhnujmikolp1234567890', // Display debugging information - debug => ($_SERVER['SERVER_NAME'] === 'localhost') + debug => false, + + // Complete URL to your directory (including tracing slash) + url => 'http://strace.club/', ); @@ -57,9 +60,6 @@ // Name of this file $data['scriptname'] = pathinfo(__FILE__, PATHINFO_BASENAME); - // URL to upload page - $data['pageurl'] = "http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/'; - // Use canonized path $data['uploaddir'] = realpath($settings['uploaddir']); @@ -147,19 +147,10 @@ return; } - - echo '
';
-		print_r($data);
-		echo '
'; - - if (move_uploaded_file($data['tmp_name'], $data['upload_target_file'])) { if ($settings['allow_deletion']) $_SESSION['upload_user_files'][] = $data['target_file_name']; - echo $data['pageurl'] . $data['upload_target_file'] . "\n"; - // echo 'File: ' . $data['uploaded_file_name'] . ' successfully uploaded:
'; - // echo 'Size: '. number_format($_FILES['file']['size'] / 1024, 3, '.', '') .'KB
'; - // echo 'File /URL: http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$data['upload_target_file'].''; + echo $settings['url'] . $data['target_file_name'] . "\n"; } else { echo 'Error: unable to upload the file.'; }