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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0, 8.6.1
    • Fix Version/s: 8.6.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.2 S1, ZK 8.6.2 S2

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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