Carry out the following steps:
Create a new entity called
ImageUpload
with the following table structure:CREATE TABLE IF NOT EXISTS image_uploads ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY , filename VARCHAR( 255 ) NOT NULL , thumbnail VARCHAR( 255 ) NOT NULL , label VARCHAR( 255 ) NOT NULL , user_id INT NOT NULL, UNIQUE KEY (filename) );
Create the relevant
ImageUpload
entity in thesrc/Users/Model/ImageUpload.php
file, theTableGateway
object in thesrc/Users/Model/ImageUploadTable.php
file, and theController
(MediaManagerController
) inside the module (CommunicationApp/module/Users
) in thesrc/Users/Controller/MediaManagerController.php
file.In the
Upload
form'sSubmit
process, generate the thumbnail by using a new method calledgenerateThumbnail()
; this method will take the filename of the existing image as the parameter. Theresize
method resizes the image to 75x75 px and...