Download the PHP package hassan/laravel-s3-browser-based-uploads without Composer

On this page you can find all versions of the php package hassan/laravel-s3-browser-based-uploads. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-s3-browser-based-uploads

Laravel S3 Browser Based Uploads

Latest Version on Packagist Build Status Total Downloads License

Upload files to AWS S3 directly from the browser using presigned POST requests, reducing server load and bandwidth usage.

Requirements

Installation

1. Install the package via composer

For Laravel 9+, you may need to install Flysystem dependencies:

2. Publish the config file

3. Configure your AWS credentials

Add your AWS settings to .env:

4. Configure S3 CORS (Required!)

For browser uploads to work, you must configure CORS on your S3 bucket. Add this CORS configuration in your AWS S3 Console:

Important: Replace https://yourdomain.com with your actual domain(s). For local development, you may add http://localhost:8000 or use ["*"] (not recommended for production).

Usage

Basic Usage

Example

Check out the demo with Filepond

Using Credentials Routes

You can optionally register a route that returns the credentials as JSON:

This creates an endpoint that returns:

Security Considerations

⚠️ Important Security Warnings

  1. Filename Sanitization: Using ${filename} in your config can expose you to path traversal attacks. Consider:

  2. File Size Limits: Always set content-length-range in your config to prevent abuse:

  3. Content-Type Validation: Restrict file types using conditions:

  4. Short Expiration Times: Use short-lived URLs (1-15 minutes recommended):

  5. Rate Limiting: The credentials endpoint includes default rate limiting (60 requests/minute). Adjust as needed.

  6. HTTPS Only: Always use HTTPS in production to prevent credential interception.

  7. Bucket Permissions: Set appropriate S3 bucket policies and ACLs. Avoid public write access.

AWS IAM Permissions

Your AWS IAM user needs these S3 permissions:

Known Limitations

Security Disclosure

If you discover any security related issues, please email [email protected] instead of using the issue tracker.


All versions of laravel-s3-browser-based-uploads with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
aws/aws-sdk-php Version ^3.0
league/flysystem-aws-s3-v3 Version ^3.0
graham-campbell/manager Version ^4.7|^5.0
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/contracts Version ^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hassan/laravel-s3-browser-based-uploads contains the following files

Loading the files please wait ...