Download the PHP package pa-bru/file-uploader without Composer
On this page you can find all versions of the php package pa-bru/file-uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pa-bru/file-uploader
More information about pa-bru/file-uploader
Files in pa-bru/file-uploader
Package file-uploader
Short Description File uploader for PHP
License MIT
Homepage https://github.com/Seldaek/monolog
Informations about the package file-uploader
# FileUploader!
Presentation
FileUploader is a php class which enables you to upload files on your website !
features :
- Upload various type of files. You can choose the allowed formats.
- Rename uploaded files
- Choose location of the uploaded files
- Image resizing
Installation
FileUploader is available via Composer/Packagist, so just add this line to your composer.json
file:
or
Usage
Call the class:
$file : File upload data table $file is required
$args : table arguments that can be passed to the constructor
$args is optional. eg: $uploader = new FileUploader($file);
Properties
fileName
: name of file. If not specified, a single string is assigned.contentDir
: Destination folder of the file added. The folder is created if it does not exist.allowedExts
: Table of allowed extensions.maxSize
: The maximum file size in bytes.width
: In pixel (px) for resizing images (PNG, JPEG, JPG, GIF).height
: In pixel (px) for resizing images (PNG, JPEG, JPG, GIF).
Get the parameters (Getters) :
-
Get file extension :
-
Get the destination path of the file :
-
Get the height to be assigned to the image file :
-
Get the width to be assigned to the image file :
-
Get the maximum file size :
-
Get the destination folder of the file :
-
Get the filename :
-
Get file data table :
- Get the allowed extensions for uploading a file :
Set the parameters (Setters) :
-
Set file path :
-
Set the height to be assigned to the file (if it is an image) :
-
Set the width to be assigned to the file (if it is an image):
-
Set the maximum size allowed for file upload :
-
Set the destination folder of the file :
-
Set the name to be assigned to the file :
-
Set the file to upload :
- Set the table of allowed extensions for file upload :
Launch upload :
If successful the upload () method returns the path of the uploaded file.
Releases
v1.0 :
- Initial Version
Author
- Paul-Adrien Bru Linkedin
Copyright © 2016 Paul-Adrien Bru | MIT license