Details
Description
DeviceCoreRenderer sets the accept type which provides features on mobile devices but interferes with desktop uploads. The following code should be disabled for desktop browsers:
if (comptype.equals("camera")){
writer.writeAttribute("accept", "image/*");
}
if (comptype.equals("camcorder")){
writer.writeAttribute("accept", "video/*");
}
if (comptype.equals("microphone")){
writer.writeAttribute("accept", "audio/*");
}
if (comptype.equals("camera")){
writer.writeAttribute("accept", "image/*");
}
if (comptype.equals("camcorder")){
writer.writeAttribute("accept", "video/*");
}
if (comptype.equals("microphone")){
writer.writeAttribute("accept", "audio/*");
}
when I tested this, this worked well, as a filter to eliminating possible files that were of incorrect type to upload. Which browser are you referring to? I tested on desktop Chrome, Safari, Firefox and IE9 when I implemented this. Something may have changed since then, so would rather document that, otherwise, user will be able to attempt to upload any filetype (rather than the file chooser filtering out some) and the server will complain on the decode of these components.