Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2518

The "accept" attribute of Button used to upload doesn't work for multiple file type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Normal
    • 7.0.6
    • 7.0.3, 7.0.5
    • ZK Client Engine
    • Security Level: Jimmy
    • chrome 38, firefox

    • ZK 7.0.7

    Description

      Problem Description

      A forum user reported http://forum.zkoss.org/question/94362/upload-attribute-accept-multiple-file-extensions/

      The syntax for "accept" attribute is described in http://books.zkoss.org/wiki/ZK_Component_Reference/Essential_Components/Button#Upload

      Steps to Reproduce

      1. run the zul below
           <zscript><![CDATA[
        	import org.zkoss.util.media.Media;;
          	public void myProcessUpload(UploadEvent event){
          		System.out.println("uploaded");
          		Media media = event.getMedia();
          		System.out.println("uploaded "+media.getName()+", size:"+(media.getByteData().length/1024)+" k bytes");
          	}
          ]]>
          </zscript>
        <button label="file extension" upload="true,maxsize=-1,accept=.png|.pdf" onUpload="myProcessUpload(event)"/>
        
      2. click the button

      Actual Result

      popup dialog cannot display png and pdf file


      Expected Result

      filter both png and pdf files

      Attachments

        1. correctFileFilter.png
          correctFileFilter.png
          19 kB
        2. fileFilter.png
          fileFilter.png
          18 kB
        3. pngpdf.png
          pngpdf.png
          15 kB

        Activity

          People

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m