Question: I was task to do this 4 items. Now i only need is number 4 how can i make it work 1) File Upload Form
I was task to do this 4 items. Now i only need is number 4 how can i make it work
1) File Upload Form Markup
Create a valid HTML file containing a form capable of uploading a single image.
The form can either POST to itself or to another PHP script.
2) File Persistence Write the code required to save uploaded files submitted by the form created in part 1.
Files should be saved to an uploads sub-folder of your challenge folder.
3) File Type Whitelisting Add to your code from part 2 to ensure that your image uploader only accepts JPG, PNG and GIF images as well as PDF documents. Other types of files should not be saved to the uploads sub-folder. Note that you may use the mime_content_type function to get the MIME type of a file. The way we have in the example only works for image files (so it won't work for PDF docs).
4) Image Resizing Use this open-source PHP Image Resize library (https://github.com/gumlet/php-image-resize) to resize all images processed by your file uploader.
Three versions of each image should be saved:
Original Version: original_filename.ext
Resized Max Width 400px: original_filename_medium.ext
Resized Max Width 50px: original_filename_thumbnail.ext PDF uploads should be saved unmodified.
To include the Image Resize PHP files in your script, use the full path, e.g.
require \xampp\htdocs\a\php-image-resize-master\lib\ImageResize.php;
require \xampp\htdocs\a\php-image-resize-master\lib\ImageResizeException.php;
Also note that the Gumlet Image Resize Library uses functions in the GD library(https://www.php.net/manual/en/refs.utilspec.image.php).
The GD library may not be enabled by default. To enable the GD extension, just edit the php.ini file (via XAMPP, click the Apache "Config" button), and uncomment the line "extension=gd"; then, restart Apache.
coding of 1 to 3 is as per below.
I only need coding for number 4 and what are the things need to be done. Do i need to create another .php?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
