From 440d5efd59a5ff87b3a40599a594d3e2f0e0e637 Mon Sep 17 00:00:00 2001 From: AndcoolSystems Date: Thu, 25 Jan 2024 20:53:02 +0300 Subject: [PATCH] added open button --- 404.html | 57 ++++++++++++++++++++++++++++++++++---- main.py | 5 ++-- web/res/external-link.png | Bin 0 -> 480 bytes web/script.js | 20 +++++++++++-- web/style.css | 13 +++++++++ 5 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 web/res/external-link.png diff --git a/404.html b/404.html index 5fff4dc..f987d83 100644 --- a/404.html +++ b/404.html @@ -24,15 +24,31 @@ text-align: left; } + #main_div{ + text-align: center; + } + #second_div{ + display: flex; + justify-content: center; + } h1{ font-family: 'Roboto Mono', monospace; font-weight: 400; } + pre{ + font-family: 'Roboto Mono', monospace; + font-weight: 400; + font-size: 80%; + text-align: left; + } + hr{ border: 1px solid rgb(105, 105, 105); } - p{font-size: 110%;} + p{ + font-size: 100%; + } nav a{ @@ -48,14 +64,12 @@ #login_mess{ font-style: italic; } - #main_div{ - text-align: center; - } @media(max-width: 425px){ main{width: 90%;} h1{font-size: 130%;} p{font-size: 90%;} + pre{font-size: 50%;} } @@ -67,8 +81,39 @@

File uploader


-

404

-

Hmmm... It looks like the file has not been found.

+
+
+                    .:
+                    !&J
+                    ~GP:
+                    !#?
+            :^:. .!J7.
+           .JB&@@B~?57.                     ..:^~!7JY?
+       .~?:G@@@@B?#@@@&7       ..:^~!7?JJYYY5PG&@#PJ77~
+     .J#B^!@@@@@&&@@@@@&.!JYYYY55YYJ?!~^~!?Y55J7~!?5B@#
+     ^@@! ^@@@@@@@@@@@@B.^J&#G!     .~?Y5Y?!~!JP#@@@@@B
+⠀⠀^JYY57!#G  ?B@@@@@@@@#5: .7^.~7Y55J!^~7YG&@@@@@@@@@B
+Y@#7:  .?^ 7G?7?JYY?^.  ~55?7J55J7^^~?P#@@@@@@@@@@@#P?^
+Y#!5PY7~:.  !GPY5Y7.  :!J55Y7~:^!JG&@@@@@@@@@@&BY!:  :~
+Y#  .~7JY555YYGBPYJJY55J!::^75B&@@@@@@@@@@#PJ~. .^?P#@#
+Y#        ..:::^^^^^^.:~?P#@@@@@@@@@@&B57^  :!JG&@@@@@B
+Y#                   P&@@@@@@@@@@&GY!:  ^75B&@@@@@@@@@B
+Y#                  .&@@@@@@@#P?~. .~JP#@@@@@@@@@@&B57:
+Y#                  .&@@&B57:  :!YG&@@@@@@@@@@&GJ!::~?J
+Y#                  .5J~. .^?5#@@@@@@@@@@@#P?~:^!YG&@@#
+Y#       404          .~JG#@@@@@@@@@@&BY7^:^75B@@@@@@@#
+Y#                  .P&@@@@@@@@@@#GJ~::~JP#@@@@@@@@@@@P
+Y#                  .&@@@@@@@B5?^:^!YB&@@@@@@@@@@&GY!:
+Y#                  .&@@&GY!^:~?P#@@@@@@@@@@@#P?~.
+Y#                  .5J~::!JG&@@@@@@@@@@&B57^.
+Y#                   :75B&@@@@@@@@@@#GJ!:
+!&!                 .#@@@@@@@@@@B5?^.
+~GP!:              .&@@@@@&GY!:
+    ~J55YJ?7!~~^^^^^~!@@#PJ~.
+    .^~!7??JJJJJJJJ7^.
+                    
+
+

The file is a lie.

diff --git a/main.py b/main.py index bd9e7f8..ad070bd 100644 --- a/main.py +++ b/main.py @@ -2,7 +2,6 @@ created by AndcoolSystems, 2023-2024 """ - from fastapi import FastAPI, UploadFile, Request, Header from fastapi.responses import JSONResponse, FileResponse, Response from typing import Annotated, Union @@ -43,6 +42,8 @@ check_period = 86_400 # File check period (unused) + + @app.on_event("startup") async def startup_event(): await db.connect() # Connecting to database @@ -102,7 +103,7 @@ async def upload_file(file: UploadFile, request: Request, include_ext: bool = Fa saved_to_account = True key = str(uuid.uuid4()) # Generate unique delete key - ext = "." + file.filename.split(".")[-1] # Get file extension + ext = "." + file.filename.split(".")[-1].lower() # Get file extension fid = utils.generate_token(10) + (ext if include_ext else "") # Generate file url fn = str(uuid.uuid4()) + ext # Generate file name diff --git a/web/res/external-link.png b/web/res/external-link.png new file mode 100644 index 0000000000000000000000000000000000000000..e9e742fb42da13fd84df8fbd35e98b9b17a430cc GIT binary patch literal 480 zcmV<60U!Q}P)HauLxg6e2;`N~80qkWiC|r65PK^O9%w&Axq`jcQMGXXf5}&Y3rvdC)@&tkXtG z^T4FH{0;1y*;}-bOK3D;5hwt|vD6Q6U}ooTUIj)Iv~$2_PypBmRszPyfk6SpM^1lhxT^!2D6V=!K zgn!7_E>qyjJtjI^)N3J0000