This project is a simple Flask-based web application that allows users to upload text, which is saved as a temporary file on the server. Files are automatically deleted after 10 minutes to maintain a clean environment.
- Upload and save text as
.txt
files. - Automatically deletes files after 10 minutes.
- Responsive and user-friendly web interface.
- Simple and minimalistic design.
- Python 3.7+
- Flask
- APScheduler
-
Clone this repository:
git clone https://github.com/stigsec/flask-text-share.git cd flask-text-share
-
Install the required Python packages:
pip install flask apscheduler
-
Run the application:
python app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5003/
-
Enter your text in the textarea, upload it, and get a link to view the uploaded file.
.
├── app.py # Main Flask application
├── templates/
│ ├── index.html # Home page for uploading text
│ ├── upload_done.html # Confirmation page after uploading text
├── files/ # Directory to store uploaded files
└── README.md # Project README file
- Users enter their text into a textarea and submit it.
- The text is saved as a
.txt
file with a random name in thefiles/
directory. - A job is scheduled to delete the file after 10 minutes using APScheduler.
- Users can view the uploaded file via a unique link.
- File Expiry: Adjust the
timedelta(minutes=10)
value inapp.py
to change how long files are retained. - File Storage Path: Modify the
upload_dir
variable inapp.py
to change the directory for saving files. - Styling: Update the CSS styles in
index.html
andupload_done.html
to customize the UI.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.
- Flask documentation: https://flask.palletsprojects.com
- APScheduler documentation: https://apscheduler.readthedocs.io