From d85e35d0d5d640e5a66be0ce8adcd4b5684fcd98 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Sat, 14 Nov 2020 22:35:26 +0100 Subject: [PATCH] POSTing to / is now possible --- http/index.cgi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/http/index.cgi b/http/index.cgi index e6a04f7..28052b2 100755 --- a/http/index.cgi +++ b/http/index.cgi @@ -19,8 +19,12 @@ my $disk_usage = `df -h | awk 'NR==2 {print \$3; exit}'`; my $disk_free = `df -h | awk 'NR==2 {print \$4; exit}'`; my $disk_percentage = `df -h | awk 'NR==2 {print \$5; exit}'`; -print "Content-type: text/html\n\n"; +if ($ENV{REQUEST_METHOD} eq "POST") { + do "./upload.cgi"; + exit; +} +print "Content-type: text/html\n\n"; print " @@ -37,9 +41,9 @@ print " star me - - +

Terminal usage

+

I recommend using lainsafecli to upload files to lainsafe, however, there is more than one way to do it.

+ curl -F 'file=@1605388889.png' $ENV{HTTP_HOST}$ENV{REQUEST_URI}
+print $disk_free . available from . $disk_size . total; "; - -print $disk_free ." available from ". $disk_size ." total";