PHP & jQuery - File/image uploader
For this example I created a page where a user can upload files & images to a web server. The items are stored and reflected so the user can see their multiple uploads. With PHP below I am handling the uploads and if the file already exists the user is notified that they are trying to do a duplicate upload.
And here this is defining the main work being done by this page. This is handling the file type to only allow images with extensions of: .gif, .jpg, .png, .jpeg. The size is also restricted to 500KB.
This is what the page looks like below with a little formatting. The alert below was triggered by trying to upload a file without one of the allowed extensions.
In this block I create the div tags for the "dropZone" above and set the input type to handle the multiple attachments as an array.
Comments
Post a Comment