I am trying to achieve two actions from an input file
tag. I have the following input:
<input id='file-input' name='attach' type='file' style='margin-left:15px;'/>
This is found in messages.php
. What I am trying to achieve are two things:
- If the file uploaded is over 1mb in size (or is a file which is not an image), then produce a button which on click opens the
save as
menu, from where a user can select where they wish to download the data. - And secondly, as mentioned, if the file size is lower than 1mb, then simply display the data on the page (only works for image files).
I have other pages where I have used input type="file"
to upload profile images, and have just displayed the image on the page. But I am unsure on how I can execute (1) - how I can open a menu from where the user can save the data?