jeecg視頻上傳問題


1.jsp代碼:

<div class="form-group" align="center">
              <div class="col-md-4 col-sm-4  col-xs-4 col-lg-4">視頻文件
                 <t:webUploader name="path"  buttonStyle="btn-green btn-M mb20" bizType="videos"  auto="true" fileNumLimit="1"></t:webUploader>
                 <span class="Validform_checktip Validform_right" style="display: none;">文件已上傳</span>
                  <!-- <input id="file" name="file" type="file" class="form-control input-sm" style="margin-left: 150px;width: 203%;"/>  -->
              </div>
</div>

2.對應的easyui.tld配置文件;

 

 

 

 

 

 3.文件上傳處理url;

WebUploaderTag中的參數:private String url = "systemController/filedeal.do";//文件上傳處理url

對應的systemController的filedeal方法中

String bizPath=StoreUploadFilePathEnum.getPath(bizType);//根據業務名稱判斷上傳路徑

StoreUploadFilePathEnum枚取類加上

VIDEOS("videos", "upload"+File.separator+"videos");//視頻類

這樣就添加了視頻類型文件。

4.文件大小設置,

位置1:WebUploaderTag中的private int fileSingleSizeLimit=1073741824;//fileSingleSizeLimit單個文件最大1G[1024*1024*1024]考慮視頻大小

位置2:在spring-mvc.xml中修改:

<bean id="multipartResolver"
  class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
  p:defaultEncoding="UTF-8">
    <property name="maxUploadSize">
      <value>1073741824</value><!-- 設置最大為1G -->
    </property>
      <property name="maxInMemorySize">
      <value>4096</value>
    </property>
</bean>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM