diff --git a/LICENSE b/LICENSE deleted file mode 100644 index fbabcf0..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 ZastyK - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 77b10a2..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# FileHosting -I want to show my analog of the File io service. Anyone can download ‘html’, ‘css’, ‘js’, ‘png’, ‘jpg’, ‘jpeg’, ‘gif’, ‘ico’, ‘svg’. diff --git a/templates/index.html b/index.html similarity index 97% rename from templates/index.html rename to index.html index 0413f01..a73c5e6 100644 --- a/templates/index.html +++ b/index.html @@ -1,260 +1,260 @@ - - - - - FileHosting by Ivan0n | Загрузка сайта - - - - -

FileHosting by Ivan0n

-

Сделайте ваш файл публичным

-

('html', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg')

-
- -
Перетащите файлы сюда
- -
-
-
-
- - - + + + + + FileHosting by Ivan0n | Загрузка сайта + + + + +

FileHosting by Ivan0n

+

Сделайте ваш файл публичным

+

('html', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg')

+
+ +
Перетащите файлы сюда
+ +
+
+
+
+ + + diff --git a/main.py b/main.py deleted file mode 100644 index f6b82fa..0000000 --- a/main.py +++ /dev/null @@ -1,46 +0,0 @@ -from flask import Flask, request, jsonify, send_from_directory, render_template -import os -from werkzeug.utils import secure_filename - -app = Flask(__name__) - -UPLOAD_FOLDER = 'public' -ALLOWED_EXTENSIONS = {'html', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg'} - -app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER - -def allowed_file(filename): - return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS - -@app.route('/', methods=['GET', 'POST']) -def upload_files(): - if request.method == 'POST': - if 'files[]' not in request.files: - return jsonify(success=False, error='Нет файлов в запросе'), 400 - - files = request.files.getlist('files[]') - if not files: - return jsonify(success=False, error='Файлы не выбраны'), 400 - - saved_files = [] - - for file in files: - if file and allowed_file(file.filename): - filename = secure_filename(file.filename) - save_path = os.path.join(app.config['UPLOAD_FOLDER'], filename) - file.save(save_path) - saved_files.append(filename) - else: - return jsonify(success=False, error=f'Файл "{file.filename}" имеет недопустимый формат'), 400 - - return jsonify(success=True, files=saved_files), 200 - - return render_template('index.html') - -@app.route('/public/') -def serve_public_file(filename): - return send_from_directory(app.config['UPLOAD_FOLDER'], filename) - -if __name__ == '__main__': - os.makedirs(UPLOAD_FOLDER, exist_ok=True) - app.run(host='0.0.0.0', port=5555, debug=True) diff --git a/public/0c2a55f0ab63079c.png b/public/0c2a55f0ab63079c.png deleted file mode 100644 index 7600929..0000000 Binary files a/public/0c2a55f0ab63079c.png and /dev/null differ diff --git a/public/5b8e7c80e6373f287743cf9b3a913443.jpg b/public/5b8e7c80e6373f287743cf9b3a913443.jpg deleted file mode 100644 index d7a6659..0000000 Binary files a/public/5b8e7c80e6373f287743cf9b3a913443.jpg and /dev/null differ diff --git a/public/dsahjk.html b/public/dsahjk.html deleted file mode 100644 index 0107cb4..0000000 --- a/public/dsahjk.html +++ /dev/null @@ -1 +0,0 @@ -

ddsa-=dsahjdlsah

\ No newline at end of file diff --git a/public/html b/public/html deleted file mode 100644 index 0107cb4..0000000 --- a/public/html +++ /dev/null @@ -1 +0,0 @@ -

ddsa-=dsahjdlsah

\ No newline at end of file diff --git a/public/togif-1-1.gif b/public/togif-1-1.gif deleted file mode 100644 index 7d9f86a..0000000 Binary files a/public/togif-1-1.gif and /dev/null differ