My website allows users to upload images. The upload functionality works perfectly, as long as there is a file to choose. However, when I access my website on my iPhone, and try to upload a photo, I'm given choices of choosing a file, or taking a photo with the iPhone camera. When I choose the option of taking a photo, my website crashes. Can someone help me with this?
Here's the input code:
<input id="uploadStatus" type="file" name="photo" accept="image/*" onchange="loadFileStatus(event)" hidden>
And here's the javascript code:
reader.onload = function(){
var output = document.getElementById('outputstatus');
output.src = reader.result;
};
reader.readAsDataURL(event.target.files[0]);
}; ```
Thank you in advance.