ThinkCMF封装了文件上传,开发者只要在模板中使用已经封装好的 js 方法就可以了
比如上传一张图片的代码:
<input id="photo-1" type="hidden" name="photo_url" >
<input id="photo-1-name" type="text" name="photo_name" title="图片名称">
<img id="photo-1-preview" >
<a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
其它相关上传方法在admin.js
和frontend.js
中。