2023-09-28 21:29:21 +02:00
< ? php
/* curload
* Simple file uploading using POST requests and temporary keys
* Licensed under the GNU Affero General Public License version 3.0
*/
2023-10-01 17:27:47 +02:00
include " config.php " ; /* config.php includes configuration options */
include " core.php " ; /* core.php includes core functions */
// We declare these variables first
$Error = " " ;
$html = " " ;
// If an error was reported, assign it to variable $Error
if ( isset ( $_REQUEST [ 'e' ])) $Error = $_REQUEST [ 'e' ];
// Print some HTML, bar and a basic heading and description paragraph
// \t - Tab character
// \n - New line character
// .= - Append to variable
$html = printHeader ( $html );
$html .= " \t \t \t <h1> $instanceName </h1> \n " ;
$html .= " \t \t \t \t <p> $instanceDescription </p> \n " ;
// If logged in ...
if ( isset ( $_COOKIE [ $cookieTypeName ]) || ( $publicUploading || $publicUploading == " true " )) {
2023-10-01 17:46:46 +02:00
$html = printFileUploadForm ( $html , $Error );
2023-10-01 17:27:47 +02:00
} else {
$html .= " \t \t \t \t <p>To upload a file, <a href= \" login.php \" >log in using your key</a> and select a file to upload. After uploading, you will receive a link to the file stored on the servers.</p> \n " ;
2023-09-30 20:31:01 +02:00
}
2023-10-01 17:41:02 +02:00
$html .= " \t \t \t \t <p>You can also upload a file using <code>curl</code> (or any POST request):<br><br><code>curl -F \" file=@myfile \" -F \" key=mykey \" \" https://dl.speedie.site/upload.php \" </code>.</p> \n " ;
2023-10-01 17:27:47 +02:00
// End the content div and print footer
$html = printFooter ( $html );
// Finally print it all out at once
print " $html " ;
2023-09-28 21:29:21 +02:00
?>