Download the PHP package delight-im/file-upload without Composer
On this page you can find all versions of the php package delight-im/file-upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delight-im/file-upload
More information about delight-im/file-upload
Files in delight-im/file-upload
Package file-upload
Short Description Simple and convenient file uploads — secure by default
License MIT
Homepage https://github.com/delight-im/PHP-FileUpload
Informations about the package file-upload
PHP-FileUpload
Simple and convenient file uploads — secure by default
Requirements
- PHP 5.6.0+
Installation
-
Include the library via Composer [?]:
-
Include the Composer autoloader:
-
Set up your HTML form for the file upload, e.g.:
The two attributes
method="post"
andenctype="multipart/form-data"
on the<form>
element are mandatory. Likewise, there must be at least one<input type="file">
element with a propername
attribute. Finally, some way to submit the form, e.g. the<button type="submit">
element, is required. The hidden input namedMAX_FILE_SIZE
is an optional hint for the client.
Usage
- File uploads
- Limiting the maximum permitted file size
- Reading the maximum permitted file size
- Restricting the allowed file types or extensions
- Reading the allowed file types or extensions
- Reading the target directory
- Defining the target filename
- Reading the target filename
- Reading the name of the input field
- Base64 uploads
- Limiting the maximum permitted file size
- Reading the maximum permitted file size
- Defining the filename extension
- Reading the filename extension
- Reading the target directory
- Defining the target filename
- Reading the target filename
- Reading the Base64 data
- Data URI uploads
- Limiting the maximum permitted file size
- Reading the maximum permitted file size
- Restricting the allowed MIME types and extensions
- Reading the allowed MIME types and extensions
- Reading the target directory
- Defining the target filename
- Reading the target filename
- Reading the data URI
File uploads
Limiting the maximum permitted file size
Reading the maximum permitted file size
Restricting the allowed file types or extensions
Note: By default, a set of filename extensions is used that is relatively safe for PHP applications and common on the web. This may be sufficient for some use cases.
Reading the allowed file types or extensions
Reading the target directory
Defining the target filename
Note: By default, a random filename will be used, which is sufficient (and desired) in many cases.
Reading the target filename
Reading the name of the input field
Base64 uploads
Limiting the maximum permitted file size
Reading the maximum permitted file size
Defining the filename extension
Note: This defines the filename extension of the file to be uploaded, which is a property of the FileUpload
instance. It does not change the extension of any file already uploaded, which would be represented in a File
instance. By default, the filename extension bin
for arbitrary (binary) data will be used, which may be sufficient in some cases.
Reading the filename extension
Note: This retrieves the filename extension of the file to be uploaded, which is a property of the FileUpload
instance. It does not read the extension of any file already uploaded, which would be represented in a File
instance.
Reading the target directory
Defining the target filename
Note: By default, a random filename will be used, which is sufficient (and desired) in many cases.
Reading the target filename
Reading the Base64 data
Data URI uploads
Limiting the maximum permitted file size
Reading the maximum permitted file size
Restricting the allowed MIME types and extensions
Note: By default, a set of MIME types is used that is relatively safe for PHP applications and common on the web. This may be sufficient for some use cases.
Reading the allowed MIME types and extensions
Reading the target directory
Defining the target filename
Note: By default, a random filename will be used, which is sufficient (and desired) in many cases.
Reading the target filename
Reading the data URI
Contributing
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
License
This project is licensed under the terms of the MIT License.