thinkphp ajaxfileupload实现异步上传图片的示例

thinkPHP开发图片上传图片异步上传是目前比较方便的功能,这里我就不写css文件了,将代码写出来。引入核心文件下载nofollow" target="_blank" href="https://github.com/carlcarl/AjaxFileUpload">https://github.com/carlcarl/A...

HTML

下面首先在html页面引入相关js资源

rush:xhtml;"> <Meta charset="UTF-8"> <a href="https://www.jb51.cc/tag/tupian/" target="_blank" class="keywords">图片</a><a href="https://www.jb51.cc/tag/shangchuan/" target="_blank" class="keywords">上传</a>

接下来在body中创建相关div

rush:xhtml;">
Box" name="image_file" id="image_file"/>

解释一下:

其中upd_file(this,'image_file')不可缺少

其中隐藏的input 是用于上传成功后赋值图片路径,以便于form表单提交数据

接下来在html中编辑javascript脚本以便于传递和提交图片功能

rush:js;">