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

UploadEvent.getMedia().getByteData() throws an unexpected exception when uploading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • 8.6.0, 8.6.1
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.2 S1, ZK 8.6.2 S2

      Steps to Reproduce

      1. run the attached file
      2. upload a text file

      Current Result

      java.lang.IllegalStateException: Use getStringData() instead
      at org.zkoss.util.media.AMedia.newIllegalStateException(AMedia.java:358)
      at org.zkoss.util.media.AMedia.getByteData(AMedia.java:313)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)

      Expected Result

      uploaded successfully

      Debug Information

      • 8.5.0 doesn't have such issue
      • sent request is: http://localhost:8080/zk8support/zkau/dropupload?uuid=lW2Q2&dtid=z_gvo&native=undefined
        zk.UploadUtils = {
        	ajaxUpload: function (wgt, xhr, formData) {
        		var dt = wgt.desktop,
        			tempUri = zk.ajaxURI('/dropupload', {desktop: dt,au: true}),
        			ajaxUri = tempUri + (tempUri.indexOf('?') == -1 ? '?' : '&')
        				+ 'uuid=' + wgt.uuid
        				+ '&dtid=' + dt.id
        				+ '&native=' + wgt._native;
        
        

        wgt._native is undefined

      • a client widget should not send natvie which is a parameter specified at upload attribute.

            rudyhuang rudyhuang
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified