javascript - How to use Blueimp jQuery file uploader with PHP? -


I'm trying to apply the bluepp jQuery file uploader and it's a disappointing time to work in my PHP-based site Used to be .

My main problem is with AJAX What do I want to do after uploading,

  1. It redirects (let's say) abc.php < / Code>.
  2. After uploading (earlier redirecting page), I want to save the filename to the MySQL database.

    I know how to handle the database with PHP, but I do not know how I can not put my PHP code. / P>

    For the first problem I think that I main.js

      $ (function () {'strict experiment'; // initialize JQuery File upload widget: $ ('# fileupload') Enable iframe cross-domain access via the Fileupload (); // redirect option: $ ('# fileupload'). Fileupload ('option', 'redirect', Window Location.href.replace (/ \ / [^ \ /] * $ /, '/cors/result.html?%s')) // Load existing files: $ ('# fileupload'). (Function () {var that = this; $ .getJSON (this.action, function) {if (result and amp; result.length) {$ (that). Fileupload ('option', 'done'). Call it, rick {Results Results});}});});});   

    Thanks in the millions ..

    To do a redirect It may be that you have to submit the form and handle it via PHP, except that you lose the progress indicators.

    Otherwise, if I have understood you properly, you can use the callback function only on Jawaab's redirects. Completing the upload can be just one of the methods you can add such as:

      $ ('# fileupload'). Fileupload (replace the method // the same behavior as clicking {done: function (e, data) {// either href or a link window. Location.href = "/abc.php";}}) ;   

    See this answer about redirects:

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -