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

custom UrlEncoder with fileupload

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.2
    • Fix Version/s: 7.0.4
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      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}

      ),

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: