Home > Article > Backend Development > ThinkPHP upload file summary
This article summarizes several methods of uploading files by combining js and php
Thinkphp uploads files directly
Thinkphp's own upload class, supports multiple file uploads, refer to the documentation
Note: The form tag needs to add enctype="multipart/form-data"
If you want to display the image without refreshing after uploading, you need to upload it with ajax, and then set src according to the returned image address. However, ajax cannot add enctype, so you need other method.
You can use iframe http://blog.csdn.net/hytfly/article/details/6267229
You can also use xhr http://updates.html5rocks.com/2012/04/Processing-XHR2-file-uploads-in-PHP
Thinkphp+uploadify to upload files
uploadify official website: http://www.uploadify.com /
An example that can be used for testing: http://www.thinkphp.cn/topic/30225.html
Thinkphp+plupload upload files
plupload official website: http://www.plupload.com/
Copyright Statement : This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the summary of files uploaded by ThinkPHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.