From 740cc1d90843465ceb5f18a5e1e5692d462b8cf4 Mon Sep 17 00:00:00 2001 From: Tretter Date: Tue, 7 Feb 2017 20:04:34 +0000 Subject: [PATCH] initial checkin from subversion --- index.php | 509 +++++++++++++++++++++++++++++++++++++++++++++++++++++ index.php~ | 324 ++++++++++++++++++++++++++++++++++ 2 files changed, 833 insertions(+) create mode 100644 index.php create mode 100644 index.php~ diff --git a/index.php b/index.php new file mode 100644 index 0000000..ba06fc7 --- /dev/null +++ b/index.php @@ -0,0 +1,509 @@ +&1"); + exit(0); +} + +if (isset($_GET['getFileList'])) { + header('Content-type: application/json'); + header("Pragma: no-cache"); + header("Expires: 0"); + + system("cd '" . $FP . "';/bin/echo -n '{\"FileList\":['; /bin/ls | /usr/bin/sort | while read x; do if [ ! -f \".\${x}.md5\" ]; then /usr/bin/md5sum \"\${x}\" | /usr/bin/cut -c1-32 > \".\${x}.md5\"; fi; /bin/echo -n '{\"file\":{\"name\":\"'\${x}'\", \"md5\":\"'`/bin/cat \".\${x}.md5\"`'\", \"size\":\"'`/usr/bin/du -m \"\${x}\" | /usr/bin/cut -f1`'\"}},'; done; /bin/echo -n '{}]}'"); + exit (0); +} + + +if (isset($_SERVER['HTTP_X_FILENAME'])) { + // create new file if the name already exists - don't override + $origFileName=$_SERVER['HTTP_X_FILENAME']; + $fileName=$origFileName; + $i=0; + while (file_exists($FP . $fileName)) { + $fileName=$origFileName . "." . ++$i; + } + + //file_put_contents( $FP . $fileName, file_get_contents('php://input')); + writefile_chunked($FP . $fileName); + echo $fileName . " uploaded"; + system("cd '" . $FP . "';/usr/bin/md5sum '" . $fileName . "' | /usr/bin/cut -c1-32 > '." . $fileName . ".md5'"); + exit(0); +} + +if (isset($_GET['kill'])) { + unlink($FP . $_GET['kill']); + unlink($FP . "." . $_GET['kill'] . ".md5"); + exit(0); +} +?> + + + + NetSquat-Downloader + <?php + echo "[". $_SERVER['PHP_AUTH_USER'] . "]"; + ?> + + + + + + Down-loader by joe@netsquat.com +
+
+
Upload local file +
+ +
or drop files here
+
+
+
+
+ +
+
Download remote url + + +
+
+
+
+ + + + +
FileSize(MB)MD5KILL
+ +
+
+

Status Messages

+
+ + + + + + + diff --git a/index.php~ b/index.php~ new file mode 100644 index 0000000..0627903 --- /dev/null +++ b/index.php~ @@ -0,0 +1,324 @@ +&1"); + exit(0); +} + +if (isset($_GET['getFileList'])) { + header('Content-type: application/json'); + header("Pragma: no-cache"); + header("Expires: 0"); + + system("cd '" . $FP . "';/bin/echo -n '{\"FileList\":['; /bin/ls | /usr/bin/sort | while read x; do if [ ! -f \".\${x}.md5\" ]; then /usr/bin/md5sum \"\${x}\" | /usr/bin/cut -c1-32 > \".\${x}.md5\"; fi; /bin/echo -n '{\"file\":{\"name\":\"'\${x}'\", \"md5\":\"'`/bin/cat \".\${x}.md5\"`'\", \"size\":\"'`/usr/bin/du -m \"\${x}\" | /usr/bin/cut -f1`'\"}},'; done; /bin/echo -n '{}]}'"); + exit (0); +} + + +if (isset($_SERVER['HTTP_X_FILENAME'])) { + file_put_contents( $FP . $_SERVER['HTTP_X_FILENAME'], file_get_contents('php://input')); + echo $_SERVER['HTTP_X_FILENAME'] . " uploaded"; + system("cd '" . $FP . "';/usr/bin/md5sum '" . $_SERVER['HTTP_X_FILENAME'] . "' | /usr/bin/cut -c1-32 > '." . $_SERVER['HTTP_X_FILENAME'] . ".md5'"); + exit(0); +} + +if (isset($_GET['kill'])) { + unlink($FP . $_GET['kill']); + unlink($FP . "." . $_GET['kill'] . ".md5"); + exit(0); +} +?> + + + NetSquat-Downloader + <?php + echo "[". $_SERVER['PHP_AUTH_USER'] . "]"; + ?> + + + + +

Enter URL

+
+
Upload local file + +
or drop files here
+
+
+
+
+ +
Download remote url + + + +
+ + + + +
FileSize(MB)MD5KILL
+ + +
+

Status Messages

+
+ + + + +