This is a Flask application for file sharing and emailing using AWS services. The application allows users to upload files to an AWS S3 bucket, share the file link via email, and generate a pre-signed URL for file access.
Before running the application, make sure you have the following:
- Python installed on your machine.
- An AWS account with the necessary credentials and permissions set up.
- The required Python libraries installed (
Flask,boto3,mysql-connector-python,requests).
-
Clone the repository and navigate to the project folder.
-
Install the required dependencies:
pip install Flask boto3 mysql-connector-python requests-
Set up your AWS credentials:
-
Create a file named
key.jsonwith the following structure:{ "access_key": "YOUR_AWS_ACCESS_KEY", "secret_key": "YOUR_AWS_SECRET_KEY", "bucket": "YOUR_S3_BUCKET_NAME" }Replace
YOUR_AWS_ACCESS_KEY,YOUR_AWS_SECRET_KEY, andYOUR_S3_BUCKET_NAMEwith your AWS credentials and S3 bucket name.
-
-
Start the Flask server:
python app.py-
The server will start running on http://localhost:5000.
-
Open your browser and navigate to http://localhost:5000 to access the application.
-
GET /: Renders the index.html template.
-
POST /submitForm: Handles user login form submission and checks the user's credentials against the database.
-
POST /uploadFile: Uploads a file to the specified AWS S3 bucket.
-
POST /sendemail: Sends emails with the file link to the specified recipients.
-
GET /report: Renders the report.html template.
-
Amazon S3: Used for file storage and retrieval.
-
AWS Lambda and API Gateway: Used to trigger the email sending process via a serverless API endpoint.
The application connects to a MySQL database running on the RDS instance with the following configuration:
- Host: cloudfinaldb.cl7uutdsqhvw.us-east-1.rds.amazonaws.com
- Port: 3306
- Username: admin
- Region: us-east-1c
- Database: clouddb
Ensure that you have the necessary database set up with the required user table.
This project is licensed under the MIT License. You are free to use, modify, and distribute it as per the terms of the license.
- Flask - A lightweight web framework for Python.
- boto3 - AWS SDK for Python.
- mysql-connector-python - MySQL driver for Python.
- requests - A library for sending HTTP requests.