ivan-novakov / extjs-upload-widget

File upload widget for ExtJS v4
80 stars 42 forks source link

Upload not working, "no URL specified" #36

Open pterodactor3000 opened 7 years ago

pterodactor3000 commented 7 years ago

Hi, i encountered this issue:

  1. downloaded latest version of widget,
  2. embedded in project and loaded Ext.Loader.setPath({ "Ext.ux.upload": "path/lib/upload" });
  3. created dialog window in project var w = Ext.create("Ext.ux.upload.Dialog", { uploadUrl: "api/path"}); w.show();
  4. started the app, window showed,
  5. chose some items to upload,
  6. clicked upload, and then the chrome console threw an error:

Ext.data.Connection.setOptions(): No URL specified

I tried to find a way to fix this, and saw that in your Ext.ux.upload.data.Connection in request function 'this' scope does not have '_url', only empty string in place where it should have my url. If i override the _url there, it works.

Tried another solution with defining upload manager like this: var uploader = Ext.create('Ext.ux.upload.uploader.ExtJsUploader', { url: "api/path" }); and putting it inside panel: var panel = Ext.create("Ext.ux.upload.Panel", { uploader: uploader, width: 600, height: 300 }); and then inserting it in Ext.window.Window: var w = Ext.create("Ext.window.Window", { layout: { type: "vbox" }, items: [panel]}); w.show(); still got the same error. Tried solution above with setting uploadedUrl instead of url, still the same error. Any solution?

[edit] Also, i saw something else. Tried to create uploader 'FormDataUploader', like in second example, but still the uploader created default 'ExtJSUploader'. Still with no url inside.