jQWidgets Forums

jQuery UI Widgets Forums Editors FileUpload How to use kqxFileUpload with WordPress

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 7 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • NotAFan
    Participant

    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


    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    NotAFan
    Participant

    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,
    Dirk


    Dimitar
    Participant

    Hello 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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.