0

I am working on Reactjs,I want if someone upload more than "100*100"(dynamic pixels) then user should get "Error/warning message",how can i do this ? Here is my current code

<OfficerImageUpload
                src={imgSrc ? imgSrc : DefaultProfilePic}
                alt="Officer Img for Add Officer"
                type="file"
                placeholder="No file choosen"
                name="header"
                onChange={handleNewOfficerDataChange}
                imgSrcAlt="Upload Cover Photo"
              /> 
  • You can find several solutions that answer your question in this post. [stackoverflow](https://stackoverflow.com/questions/8903854/check-image-width-and-height-before-upload-with-javascript) – Cyril Wallis-Davy Jan 08 '23 at 13:24

0 Answers0