简体   繁体   English

如何使用 jQuery 和 php 创建文件上传?

[英]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 多个图像上传(选择文件后上传而不刷新页面仅显示图像而不插入数据库)并提交其他表单数据并通过单击按钮提交所有而不刷新页面数据插入数据库。 jquery and php? jquery 和 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.用PHP上传知道,但不知道用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尊重地

Use JQuery Ajax File Upload .使用JQuery Ajax 文件上传 On server side look for your file in request.在服务器端查找请求中的文件。

I use plupload .我使用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"}]
                });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM