2.0.1: FileUploadHelper Released
Please Support:
CakePHP File Upload Plugin
Info:
- Version: 6.1.1
- Requirements: CakePHP 1.x, PHP
- Docs: CakePHP File Upload Plugin API
- Article: CakePHP File Upload Plugin Discussion and Examples
Watch:
Get it:
- Download Now
- git clone git://github.com/webtechnick/CakePHP-FileUpload-Plugin file_upload
The newest 2.0.1 release of File Upload Component now features a helper for more streamline setup and management of all your file uploading needs in CakePHP.
This new helper introduces two new features to utilize.
1) Automatic image resizing (thumbnails) for upload images (requires the GD Library). If there is no GD library present the helper uses browser resizing.
2) Input field configured based on your component configuration.
Image examples: Resizes, saves (to your uploadDir), and displays 'image.jpg' to width 250 (if GD library is installed).
If you have a custom uploadDir for each file you can set it in the options.
You can pass any other options as you would an html->image call
You can pass an id instead of a filename to the image helper as well.
File Input Examples fileUpload->input() defaults to your default FileUploadComponent configuration. (ie. fileModel => 'Upload', fileVar => 'file'). Changing your default FileUploadComponent configuration will also change the default FileUploadHelper input. YAY!
You can pass custom fields into the input.
You can pass any other options as you would into $form->input()
I hope you find the auto image thumbnails and input useful. I will be adding a new article soon.
This new helper introduces two new features to utilize.
1) Automatic image resizing (thumbnails) for upload images (requires the GD Library). If there is no GD library present the helper uses browser resizing.
2) Input field configured based on your component configuration.
Image examples: Resizes, saves (to your uploadDir), and displays 'image.jpg' to width 250 (if GD library is installed).
- //outputs <img src="/files/image.jpgx250.jpg" alt="" />
If you have a custom uploadDir for each file you can set it in the options.
- //outputs <img src="/uploads/image.jpgx250" alt="" />
You can pass any other options as you would an html->image call
- //outputs <img src="image.jpgx250.jpg" alt="image" id="the_image" />
You can pass an id instead of a filename to the image helper as well.
- $fileUpload->image(2);
File Input Examples fileUpload->input() defaults to your default FileUploadComponent configuration. (ie. fileModel => 'Upload', fileVar => 'file'). Changing your default FileUploadComponent configuration will also change the default FileUploadHelper input. YAY!
- $fileUpload->input();
- //output <input type="file" name="data[Upload][file]" />
You can pass custom fields into the input.
- //output <input type="file" name="data[Picture][fileVar]" />
You can pass any other options as you would into $form->input()
I hope you find the auto image thumbnails and input useful. I will be adding a new article soon.