I've been creating a blog website. All post images should be 800x800 resolution. On the admin page, when the author uploading image to post, if he/she will try to upload a bigger than 800x800 resolution, I want to show an alert to an author like a bootstrap danger alert. How can I do it?
Asked
Active
Viewed 148 times
1
-
Please review https://stackoverflow.com/help/how-to-ask and share your attempts. – Kamal Joshi Jan 08 '21 at 15:52
1 Answers
0
Not completely sure, but try creating it using URL.createObjectURL()
(https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL, How to make a simple image upload using Javascript/HTML), don't alter the image dimensions using css, insert the image into the page, and just get the image width and height.

Endothermic_Dragon
- 1,147
- 3
- 13