This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262411

Summary: <input type="file" accept=".pdf" /> incorrectly gives error
Product: web Reporter: terje7601
Component: HTML EditorAssignee: Milutin Kristofic <mkristofic>
Status: REOPENED ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description terje7601 2016-06-13 13:32:50 UTC
This gives the error below. However, this is valid HTML5 syntax:
https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)



Bad value ".pdf" for attribute "accept" on element "input": Expected "/" but the literal ended.
Syntax of MIME type list:
(WF2)

From line 10, column 4; to line 10, column 54
(Rule Category: Attributes)




Product Version: NetBeans IDE Dev (Build 201605200002)
Updates: Updates available
Java: 1.8.0_77; Java HotSpot(TM) 64-Bit Server VM 25.77-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_77-b03
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Milutin Kristofic 2016-07-13 13:44:21 UTC
Hi, shouldn't it be like this:
<input type="file" accept="application/pdf" /> ?
Comment 2 terje7601 2016-07-13 14:42:58 UTC
Yes, that's also valid, but ".pdf" is equally valid. Quoting from the URL in the first comment:

If specified, the attribute must consist of a set of comma-separated tokens, each of which must be an ASCII case-insensitive match for one of the following:

The string audio/*
    Indicates that sound files are accepted.
The string video/*
    Indicates that video files are accepted.
The string image/*
    Indicates that image files are accepted.
A valid MIME type with no parameters
    Indicates that files of the specified type are accepted.
A string whose first character is a "." (U+002E) character
    Indicates that files with the specified file extension are accepted.
Comment 3 Milutin Kristofic 2016-07-14 10:28:56 UTC
Ok, I tested this on https://html5.validator.nu/ which we are using for validating html in Netbeans. I will find out why it is not accepting in Netbeans.