This commit is contained in:
Trygve 2023-12-03 16:16:57 +01:00
parent 7b639d1962
commit 7afff0f376
2 changed files with 8 additions and 6 deletions

View File

@ -94,7 +94,7 @@ session_start();
<input name="new_filename" type="text" />
</div>
<div class="field-row">
<input type="checkbox" name="public" id="public_check">
<input type="checkbox" name="public" id="public_check" checked="True">
<label for="public_check">Gjør fila søkbar</label>
<button type="submit">Last opp </button>
</div>
@ -108,7 +108,7 @@ session_start();
<div class="title-bar">
<div class="title-bar-text">' . $title . '</div>
<div class="title-bar-controls">
<button aria-label="Close"></button>
<button aria-label="Close" onclick="document.getElementById(\'popup\').remove()"></button>
</div>
</div>
<div class="window-body">
@ -120,11 +120,11 @@ session_start();
if(isset($_SESSION['fileupload-response'])) {
if($_SESSION['fileupload-response'] == "success") {
$successMSG = '
<div class="window center" style="width: 300px">
<div class="window center" style="width: 300px" id="popup">
<div class="title-bar">
<div class="title-bar-text">' . $_SESSION['filename'] . '</div>
<div class="title-bar-controls">
<button aria-label="Close"></button>
<button aria-label="Close" onclick="document.getElementById(\'popup\').remove()"></button>
</div>
</div>
<div class="window-body">

View File

@ -2,9 +2,11 @@
session_start();
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
$public_url = 'filer.trygve.net/';
if(isset($_FILES['file'])) {
$file = $_FILES['file'];
$fileName = $_FILES['file']['name'];
$file_name = $file['name'];
$file_tmp = $file['tmp_name'];
@ -45,7 +47,7 @@ if(isset($_FILES['file'])) {
{
if(move_uploaded_file($file_tmp, $file_destination))
{
$path = 'https://trygve.me/filopplasting/' . $file_destination;
$path = $public_url . $file_destination;
$filLink = '<a href=" ' . $path . '" class="alert-link">' . $path . '</a>';
//echo $fillink;()
$buttonData = 'Filen ble lastet opp! <a href="' . $filLink . '" class="btn btn-info">Kopier lenke</a>';