jQWidgets Forums
jQuery UI Widgets › Forums › Editors › FileUpload › How to use kqxFileUpload with WordPress
Tagged: Angular 2 file upload, Angular file upload, file input, File Upload, fileInputName, jquery file upload, jqxFileUpload, uploadUrl, WordPress
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 7 years, 10 months ago.
-
Author
-
Hello,
I try to get the jqxFileUpload get working from within my WordPress-Plugin. I want to connect it with a php function (MyCallbackFunction) in my wordpress, that is called by admin_ajax URL (hev_ajaxObjekt.ajaxURL). My php function is used for several years and work fine.My Definition in the document.ready of my page
jQuery(‘#jqxFileUpload’).jqxFileUpload(
{browseTemplate: ‘success’,
uploadTemplate: ‘primary’,
cancelTemplate: ‘danger’,
width: 300,
uploadUrl: ({ url: hev_ajaxObjekt.ajaxURL, type: ‘post’ , data :{ action:’MyCallbackFunction’, AjaxCallFrom: “FileUpload” } }),
fileInputName: ‘fileToUpload’ }
);But I can’t get It working. Any suggestions?
Thank you.
Dirk
Hello Dirk,
The value of the jqxFileUpload property uploadUrl has to be a string. Please read the uploadUrl entry in the jqxFileUpload API documentation for more information and an example on the matter. Note the use of fileInputName, too. Finally, the tutorial Upload files with jqxFileUpload to PHP service may also be helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello Dimitar,
thank you for the answer. The use of an array in the url was only a hopeless try
With a String it dosn’t work also.But my problem resists. I can use your imageupload.php without any problems, as long as the file is not in any of my wordpress folders. When moving the same files into my wordpress plugin, it dosn’t work. No error message. It seems to reach the php but don’t performs any of the functions.
Another problem i’m facing is, that the fileupload only works, when the rights for the folder are set to 777. Thats to insecure for me.
If you have no other suggestions, the control is unfortunately for me useless.
Thanks,
DirkHello Dirk,
The jqxFileUpload control is basically a styled wrapper for a standard HTML form and input with type=”file”. If you manage to make a standard set of elements work in your project, you can share your form settings and we should be able to help you transform them to the respective jqxFileUpload properties (e.g. the uploadUrl property’s value is directly set as the inner form’s action attribute).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.