迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
怎么自定义表单中上传图片???自己的模板?求帮忙?
$p = dr_authcode([ 'size' => ($field['setting']['option']['size']), 'exts' => $field['setting']['option']['ext'], 'attachment' => $field['setting']['option']['attachment'], 'image_reduce' => $field['setting']['option']['image_reduce'], ], 'ENCODE')
$field['id']
<div class="form-group" id="dr_row_zjzp"> <label class="control-label col-md-2"><span class="required" aria-required="true"> * </span>证件照片</label> <div class="col-md-10"> <div class="row fileupload-buttonbar" id="fileupload_zjzp"> <div class="col-lg-12"> <span class="btn blue btn-sm fileinput-button"> <i class="fa fa-plus"></i> <span> 上传 </span> <input type="file" name="file_data"> </span> <button onclick="fileupload_file_remove('zjzp')" style="margin-left: 5px;display:none" type="button" class="btn red btn-sm fileinput-delete"> <i class="fa fa-trash"></i> <span> 删除 </span> </button> <span class="fileupload-process"> </span> </div> <div class="col-lg-12 fileupload-progress fade" style="display:none"> <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"> <div class="progress-bar progress-bar-success" style="width:0%;"> </div> </div> </div> </div><p class="finecms-file-ts">上传格式要求:jpg(5MB)</p><div id="fileupload_zjzp_files" class="files"><input type="hidden" id="dr_zjzp" name="data[zjzp]" value=""></div> <link href="/static/assets/global/plugins/jquery-fileupload/css/jquery.fileupload.css" rel="stylesheet" type="text/css"> <script src="/static/assets/global/plugins/jquery-fileupload/js/jquery.fileupload.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { fileupload_file_init({"name":"zjzp","ext":" \/(\\.|\\\/)(jpg)$\/i","size":5242880,"url":"\/index.php?s=api&c=file&token={dr_get_csrf_token()}&siteid=1&m=upload&p={$p}&fid={$fid}","unused_url":"\/index.php?s=api&c=file&m=input_file_list&p={$p}&fid={$fid}","input_url":"\/index.php?s=api&c=file&m=input_file_url&token={dr_get_csrf_token()}&siteid=1&p=&fid={$fid}&file=&one=1","tpl":"<div id=\"dr_zjzp_files_row\" class=\"file_row_html files_row\"><div class=\"files_row_preview preview\">{preview}<\/div><input type=\"hidden\" id=\"dr_zjzp\" class=\"files_row_id\" name=\"data[zjzp]\" value=\"{id}\" \/><\/div>","area":["80%","80%"],"url_area":["50%","300px"],"chunk":0}); }); </script></div> </div>
上传成功后又跳这个
action需要设置一个值呀
我做的表单,支持上传图片,需要可以QQ找我
fid:
创建表单生成的代码:你自己测试改动一下