Skip to content

This function securely handles file uploads by validating file types, sizes, and content. It scans files for malicious code, saves them securely in a local storage directory, and logs upload details for monitoring. Initially designed for image uploads, it can be modified to support generic files such as PDFs, Word documents, and ZIP files.

Notifications You must be signed in to change notification settings

sowidan1/Secure-file-upload

Repository files navigation

Laravel File Upload Handler

This project provides a secure and robust solution for uploading and processing image files in a Laravel application. It ensures uploaded files are validated, sanitized, and stored securely while preventing potential malicious content.

Features

  • Validates file type and size.

  • Scans and ensures uploaded files are valid images using getimagesize() and Intervention Image.

  • Strips malicious content by re-encoding the image.

  • Stores files securely in a non-web-accessible location.

  • Logs upload activities for monitoring and debugging.

  • Intervention Image

  • Laravel

About

This function securely handles file uploads by validating file types, sizes, and content. It scans files for malicious code, saves them securely in a local storage directory, and logs upload details for monitoring. Initially designed for image uploads, it can be modified to support generic files such as PDFs, Word documents, and ZIP files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages