- Where Developers Learn, Share, & Build Careers
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,
- Redirect it (let's say)
abc.php < / Code>.
- 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:
- After uploading (earlier redirecting page), I want to save the filename to the MySQL database.
Comments
Post a Comment