JiayangYing / CITS3403_PRO

MIT License
2 stars 0 forks source link

Handling image Uploads With Flask #90

Closed JiayangYing closed 4 months ago

JiayangYing commented 4 months ago

We need to develop a feature from scratch that allows sellers to securely upload images of their goods in our Flask application. The focus will be on ensuring the security and validity of the uploaded images. Key objectives include:

Limiting File Size: Introduce a mechanism to restrict the size of uploaded images to prevent server overload and mitigate the risk of denial-of-service attacks.

Validating File Contents: Ensure that uploaded files are genuine images and adhere to expected formats (e.g., JPEG, PNG). This is essential to prevent the upload of malicious content.

Securing File Uploads: Implement robust security measures to safeguard against vulnerabilities typically associated with file uploads, such as directory traversal and arbitrary code execution.

Expected Outcomes:

A set file size limit for image uploads to maintain performance and security.
Validation of file types to ensure only allowed image formats are uploaded.
Enhanced security protocols to protect the application and its users from potential threats related to file uploads.

Technical Requirements:

Update the Flask application to include checks for file size and type before processing uploads.
Utilize libraries like Pillow for image validation and werkzeug for handling uploads securely.
Implement error handling to provide user feedback when uploads do not meet the specified criteria.
loklokyx commented 4 months ago

Closed #94