I'm using this upload plugin: https://github.com/harrydeluxe/extjs-ux#extuxuploadbutton
And I want to change "url" property. Tell me please how it is possible?
I tried doing this but it doesn't work:
UploadObject.uploader.url = '/newUrl.php?ObjId=1';
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.ux': 'http://extjs.cachefly.net/extjs-4.1.1-gpl/examples/ux/',
'Ext.ux.upload': '../../ux/upload'
}
});
Ext.require(['Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.state.*',
'Ext.ux.upload.Button',
'Ext.ux.upload.plugin.Window']);
Ext.onReady(function() {
UploadObject = Ext.create('Ext.ux.upload.Button', {
renderTo: Ext.getBody(),
text: 'Select files',
//singleFile: true,
plugins: [{
ptype: 'ux.upload.window',
title: 'Upload',
width: 320,
height: 350
}
],
uploader:
{
url: '/1/getimages.php?ObjectId=',
uploadpath: '/Root/files',
autoStart: false,
max_file_size: '2020mb',
//...
}
//...
});
This UX uses the plupload plugin to upload the files, unfortunately, it does not provide a quick method for you to replace the upload url.
First, create a reference to your Upload Button, can be create like this if you have only one uploader:
var uploadButton = Ext.ComponentQuery.query('uploadbutton')[0];
the reference to the plupload plugin will be inside
uploader.uploader
so run this:If you want to keep your code, thats fine, just make sure you add the
var
before creatingUploadObject
.