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

custom UrlEncoder with fileupload

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.4
    • 7.0.2
    • Components
    • Security Level: Jimmy

      when implementing a custom URLEncoder it is possible to append a custom URL parameter e.g. (customparam=aaa) to the encoded URL which works fine in most cases:
      e.g.
      zk.ajaxURI('/somepath?param=123')
      will correctly lead to
      /application/somepath?customparam=aaa&param=123"

      or resources are loaded correctly using this parameter
      http://server:8080/application/zkau/web/c714a283/zul/css/zk.wcs?customparam=aaa

      in case of file upload additional URL parameters are appended to the URL after the call to zk.ajaxURI leading to an erroneous URL causing an error in fileupload

      http://server:8080/zksupport7/zkau/upload?customparam=aaa?uuid=aR6Q2&dtid=z_m0v&sid=0&maxsize=undefined
      (contains 2 question marks '?')

      this can be fixed in js/zul/Upload.js line 42

      instead of appending the params at the end

      action = zk.ajaxURI('/upload',

      {desktop:dt,au:true}

      ) + '?uuid=' + wgt.uuid + '&dtid=' + dt.id + '&sid=' + upload.sid
      + (upload.maxsize !== '' ? '&maxsize=' + upload.maxsize : '')
      + (upload.isNative ? '&native=true' : ''),

      they can be added before calling zk.ajaxURI

      action = zk.ajaxURI('/upload' + '?uuid=' + wgt.uuid + '&dtid=' + dt.id + '&sid=' + upload.sid
      + (upload.maxsize !== '' ? '&maxsize=' + upload.maxsize : '')
      + (upload.isNative ? '&native=true' : ''),

      {desktop:dt,au:true}

      ),

            hanhsu hanhsu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: