]> git.mxchange.org Git - simple-upload.git/commitdiff
Manual URL and debug setting
authors-ko <aleks@s-ko.net>
Wed, 15 Oct 2014 20:37:27 +0000 (21:37 +0100)
committers-ko <aleks@s-ko.net>
Wed, 15 Oct 2014 20:37:27 +0000 (21:37 +0100)
index.php

index b94b8fb7d83f700c0d2f2e45309f9f18f0416fb3..9e0208b40dc8c9212f357528dbdd13892b32fccd 100644 (file)
--- a/index.php
+++ b/index.php
                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']);
 
                        return;
                }
 
-
-               echo '<pre>';
-               print_r($data);
-               echo '</pre>';
-
-
                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: <b>' . $data['uploaded_file_name'] . '</b> successfully uploaded:<br />';
-                       // echo 'Size: <b>'. number_format($_FILES['file']['size'] / 1024, 3, '.', '') .'KB</b><br />';
-                       // echo 'File /URL: <b><a href="http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$data['upload_target_file'].'">http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$data['upload_target_file'].'</a></b>';
+                       echo $settings['url'] .  $data['target_file_name'] . "\n";
                } else {
                        echo 'Error: unable to upload the file.';
                }