当前位置: 代码迷 >> 综合 >> FormData文件上传和上传 文件操作
  详细解决方案

FormData文件上传和上传 文件操作

热度:7   发布时间:2024-02-13 00:01:40.0

 

FormData方式

html:

<div class="imageExaminationTextR"><input name="webrtc-picker-dicom" style="display:none;"class="file-upload-input"id="webrtc-picker-dicom"type="file" @change="changePickerDicom($event)" accept=".json" multiple/></div>

 

let fileList = e.target.files;let dcmList = [];let reg = new RegExp(/json$/);console.log(fileList);for (let i = 0; i < fileList.length; i++) {if (reg.test(fileList[i].name)) {dcmList.push(fileList[i]);}}let fd = new FormData();for (let i = 0; dcmList.length > i; i++) {