Download the PHP package almhdy/async-file-uploader without Composer
On this page you can find all versions of the php package almhdy/async-file-uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download almhdy/async-file-uploader
More information about almhdy/async-file-uploader
Files in almhdy/async-file-uploader
Package async-file-uploader
Short Description An asynchronous file uploader library in PHP 8.1
License MIT
Informations about the package async-file-uploader
π AsyncFileUploader π
Welcome to the AsyncFileUploader project! This amazing PHP library makes it easy to handle file uploads asynchronously with a focus on simplicity and reliability. π
π¦ Features
- β‘ Asynchronous File Handling: Processes file uploads without blocking the server.
- β File Type Validation: Only allow specific file types (JPEG, PNG, PDF).
- ποΈ Custom Upload Directory: Specify your own directory for file uploads.
- π Error Handling: Receive meaningful feedback on upload issues.
- π Max File Size Restriction: Set a maximum file size limit for uploads.
π Installation
You can include AsyncFileUploader
in your project using Composer:
Ensure your upload directory is writable! π οΈ
π Usage
Here's a quick example of how to utilize the AsyncFileUploader
:
1. Create an Upload Form
Create an HTML form to select a file:
2. Handle the Upload
In your upload.php
, use the AsyncFileUploader class:
π§ Configuration
-
Upload Directory: Specify the directory where files will be stored during initialization.
-
Allowed File Types: Customize the allowed file types in the constructor.
- Max File Size: Set a maximum file size (in bytes) for uploads.
π‘οΈ File Type Validation
By default, the allowed file types are:
- Images: JPEG, PNG
- Documents: PDF
You can modify the allowed file types by passing them during initialization.
π οΈ Error Handling
The library provides meaningful error messages. Here are some common errors:
- No file uploaded: Check that your form has a file selected.
- Invalid file type: Ensure you have the correct file type.
- Exceeded file size: Ensure your file does not exceed the specified maximum file size.
ποΈ Example Response
Hereβs what you can expect when a file is uploaded:
Successful Upload
Failed Upload
π Contributing
Contributions are welcome! If you'd like to improve AsyncFileUploader, please fork the repository and submit a pull request! π
π License
This project is licensed under the MIT License. See the LICENSE file for details.
π Support
If you have any questions or need assistance, feel free to open an issue or reach out! We are here to help! π