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

zEmbedded upload fails

XMLWordPrintable

      Steps to Reproduce

      Run a upload / download in zEmbeded app

      Current Result

      Upload fails if the embedded application and the outer application are not on the same context due to xhr not sending credentials when uploading, causing AuUploader not to store the media in the session context (since session / desktop is not found)

      Expected Result

      Upload works in embedded application

      Debug Information

       

      Workaround

      	zk.afterLoad("zk", function () {
      		zk.UploadUtils.ajaxUpload = function (wgt, xhr, formData, sid) {
      					var dt = wgt.desktop,
      						tempUri = zk.ajaxURI('/dropupload', {desktop: dt,au: true}),
      						ajaxUri = tempUri + (tempUri.indexOf('?') == -1 ? '?' : '&')
      							+ 'uuid=' + wgt.uuid
      							+ '&dtid=' + dt.id
      							+ (sid != undefined ? '&sid=' + sid : '');
      					xhr.open('POST', ajaxUri, true);
                                              //providing xhr credentials here, required for session if located in different context
      					xhr.withCredentials = true;
      					xhr.send(formData);
      				}
      	});
      

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

              Created:
              Updated:
              Resolved: