Mehd S
Mehd S

Reputation: 583

How can I create a file upload using jQuery and php?

how can i create a jQuery multiple image upload(upload without refresh page after choose file only displaying image not insert to databse) and submit additional Form Data and submit all with click on button without refresh page data insert to database. jquery and php?

like:
There is in tag form: checkbox, input:text, input:textarea, selection:option and input:file

Upload with PHP know,but do not know upload with jQuery.
Where do I start and what should I use?
give me link would tutorial or explain?
i not use of plugin, and not want get from it idea.

With respect

Upvotes: 1

Views: 410

Answers (3)

Mike Fielden
Mike Fielden

Reputation: 10153

I use plupload. Its really simple to use.

Here is the demo page.

Sample code from one of my apps:

uploader = new plupload.Uploader({
                    runtimes: 'html5,gears,flash,silverlight,browserplus',
                    browse_button: 'browse',
                    drop_element: 'uploadContainer',
                    container: 'uploadContainer',
                    max_file_size: '10mb',
                    multi_selection: false,
                    url: 'someFile.php',
                    flash_swf_url: 'http://www.plupload.com/plupload/js/plupload.flash.swf',
                    silverlight_xap_url: 'http://www.plupload.com//plupload/js/plupload.silverlight.xap',
                    filters: [{ title: "Image files", extensions: "jpg,gif,png" },
                              { title: "Pdf files", extensions: "pdf"}]
                });

Upvotes: 0

Sergey Metlov
Sergey Metlov

Reputation: 26311

Use JQuery Ajax File Upload. On server side look for your file in request.

Upvotes: 0

Corneliu
Corneliu

Reputation: 2942

Jquery Ajax File Upload Plugin

http://www.phpletter.com/Demo/AjaxFileUpload-Demo/

Upvotes: 1

Related Questions