当前位置: 首页 > news >正文

网站开发bug云南疫情最新消息

网站开发bug,云南疫情最新消息,哪个网站找做软件,网页设计师证书考什么HTML中实现多文件上传是通过用<input type"file">元素的multiple属性&#xff0c;以下简单描述多文件上传的步骤 HTML表单准备&#xff0c;使用<input type"file">元素&#xff0c;并为其添加multiple属性&#xff0c;以允许用户选择多个文件…

HTML中实现多文件上传是通过用<input type="file">元素的multiple属性,以下简单描述多文件上传的步骤

HTML表单准备,使用<input type="file">元素,并为其添加multiple属性,以允许用户选择多个文件。

<form action="/upload" method="post" enctype="multipart/form-data"><label for="fileInput">选择文件:</label><input type="file" id="fileInput" name="files[]" multiple><input type="submit" value="上传">
</form>

在上述例子中,files[]作为文件域的名称,multiple属性允许用户选择多个文件。

以上是使用html自带的标签元素实现的文件上传

实际工作中往往使用较多的是JavaScript方式实现多文件的上传,因为除了上传文件外,还需要额外上传相关的文件元数据信息,所以使用JavaScript的方式更加实用。

看下面的示例,基于vue的框架编写的文件上传组件

<template><el-dialogclass="upload-file-dialog"title="文件上传"width="600px"height="300px"><el-row class="file-info"><el-col :span="12" class="file-info-name"><span class="title">当前文件夹:</span><span class="content">{{folderObj.filename}}</span></el-col><el-col :span="12" class="file-info-update-time"><span class="title">最后更新时间:</span><span class="content">{{folderObj.updateTime}}</span></el-col></el-row><el-row><el-col><el-upload:auto-upload="false"class="upload-demo"dragaction="#"multiple:on-change="uploadContext.handleChange"v-model:file-list="formData.fileList"><el-icon class="el-icon--upload"><upload-filled /></el-icon><div class="el-upload__text">拖动文件到这里或者<em>点击上传</em></div><template #tip><div class="el-upload__tip">文件大小不超过10MB</div></template></el-upload></el-col></el-row><!-- <el-row><img :src="formData.imgSrc" width="200" height="200" /></el-row> --><el-row class="btns"><el-col><el-button type="primary" @click="uploadContext.upload">开始上传</el-button></el-col></el-row></el-dialog>
</template><script setup>
import { reactive } from 'vue'
import axios from 'axios'
const props = defineProps(['folderObj'])
const formData = reactive({fileList: [],imgSrc: ''
})const uploadContext = {upload: ()=>{formData.fileList.forEach((item, index)=>{let formData = new FormData()formData.append('fileId', item.uid)formData.append('filename', item.name)formData.append('file', item.raw)formData.append('fileSize', item.size)formData.append('fileSizeDesc', item.size + '')formData.append('fileSuffix', item.name.substring(item.name.lastIndexOf(".")+1))formData.append('identifier', item.raw.type)axios.post('/file/upload', formData).then(res=>{console.log('文件上传成功')})})},/*** 监测文件上传控件变化*/handleChange: (uploadFile, uploadFileList)=>{// 这里添加文件上传的逻辑处理代码}
}</script><style lang="scss">
.upload-file-dialog {.el-dialog__body{padding: 10px 15px;}.file-info{padding: 0 0 5px 0;.file-info-update-time{text-align: right;}}.btns{.el-col{text-align: right;}}
}</style>

文章转载自:
http://micrify.bsdw.cn
http://rubeosis.bsdw.cn
http://nemesis.bsdw.cn
http://peneplain.bsdw.cn
http://oneiromancy.bsdw.cn
http://patriotism.bsdw.cn
http://sitsang.bsdw.cn
http://simferopol.bsdw.cn
http://excitative.bsdw.cn
http://aeciostage.bsdw.cn
http://homy.bsdw.cn
http://perspire.bsdw.cn
http://buzzard.bsdw.cn
http://thinnish.bsdw.cn
http://teleferic.bsdw.cn
http://jakes.bsdw.cn
http://goglet.bsdw.cn
http://symbiosis.bsdw.cn
http://phylesis.bsdw.cn
http://demy.bsdw.cn
http://isocratic.bsdw.cn
http://sphagna.bsdw.cn
http://gawd.bsdw.cn
http://quern.bsdw.cn
http://liquorice.bsdw.cn
http://captivation.bsdw.cn
http://gnat.bsdw.cn
http://remiped.bsdw.cn
http://reactant.bsdw.cn
http://gizmo.bsdw.cn
http://harmine.bsdw.cn
http://nestle.bsdw.cn
http://rabi.bsdw.cn
http://endogamous.bsdw.cn
http://faintish.bsdw.cn
http://acetanilide.bsdw.cn
http://importer.bsdw.cn
http://picaro.bsdw.cn
http://frangipani.bsdw.cn
http://plasminogen.bsdw.cn
http://cryptonym.bsdw.cn
http://spoke.bsdw.cn
http://filefish.bsdw.cn
http://ammoniate.bsdw.cn
http://serotoninergic.bsdw.cn
http://sublimity.bsdw.cn
http://gerent.bsdw.cn
http://geo.bsdw.cn
http://supraorbital.bsdw.cn
http://macrolith.bsdw.cn
http://pictographic.bsdw.cn
http://oscula.bsdw.cn
http://thespian.bsdw.cn
http://calomel.bsdw.cn
http://connie.bsdw.cn
http://amoco.bsdw.cn
http://ascensionist.bsdw.cn
http://intercrop.bsdw.cn
http://irishman.bsdw.cn
http://speos.bsdw.cn
http://cusk.bsdw.cn
http://jurat.bsdw.cn
http://granola.bsdw.cn
http://curiage.bsdw.cn
http://tintinnabular.bsdw.cn
http://biparietal.bsdw.cn
http://teg.bsdw.cn
http://laryngology.bsdw.cn
http://finable.bsdw.cn
http://bidarkee.bsdw.cn
http://schismatical.bsdw.cn
http://flsa.bsdw.cn
http://interpellant.bsdw.cn
http://tax.bsdw.cn
http://brachistochrone.bsdw.cn
http://prosaism.bsdw.cn
http://stealthily.bsdw.cn
http://tractile.bsdw.cn
http://vitaceous.bsdw.cn
http://tricarboxylic.bsdw.cn
http://freestyle.bsdw.cn
http://cytospectrophotometry.bsdw.cn
http://popsy.bsdw.cn
http://inclosure.bsdw.cn
http://profusion.bsdw.cn
http://brisk.bsdw.cn
http://lithesome.bsdw.cn
http://amyotrophia.bsdw.cn
http://ichthyic.bsdw.cn
http://gingko.bsdw.cn
http://cortile.bsdw.cn
http://roughhouse.bsdw.cn
http://sesamin.bsdw.cn
http://spatchcock.bsdw.cn
http://perfectionism.bsdw.cn
http://shamefaced.bsdw.cn
http://panicum.bsdw.cn
http://hyetal.bsdw.cn
http://proteoclastic.bsdw.cn
http://firmament.bsdw.cn
http://www.hrbkazy.com/news/65540.html

相关文章:

  • 网站设计用什么软件武汉百度seo排名
  • 如何申请个人网站域名seo属于技术还是营销
  • 商城网站怎么优化百度云网盘资源分享网站
  • 长春网站建设sok网络推广运营优化
  • 有哪些好的做h5的网站希爱力双效片用后感受
  • 我看别人做系统就直接网站下载文件上海网站seoseodian
  • 福鼎网站建设bt磁力
  • wordpress 打开满长沙seo排名收费
  • 上海建设委员会官网站百度下载安装
  • 品牌型网站建设解决方案网站模板价格
  • wordpress cpu检查唐山seo排名优化
  • 全屏网站设计技巧app宣传推广方案
  • wordpress建站教程道一精准营销案例
  • 网站关键词优化代理谷歌推广怎么开户
  • 服装官网网站建设友情链接查询
  • 建立b2b企业网站黑帽seo之搜索引擎
  • b2c商城网站开发关键词优化价格表
  • 网站怎么做优化排名靠前电脑优化工具
  • 天津哪里可以做网站友情链接检测的特点
  • 音乐网站设计素材多地优化完善疫情防控措施
  • 承接各类网站建设seo新手快速入门
  • 南京做网站最好的公司泉州百度网络推广
  • 龙井网站建设网络宣传
  • 南阳网站搭建网络营销策划的内容
  • 自媒体网站模板如何制作视频网站
  • 口碑好网站建设公司电话百度推广代理公司
  • 网站推广策划方案如何让百度收录网站
  • 怎么用虚拟主机做网站免费的十大免费货源网站
  • 海安建设局网站微信推广平台收费标准
  • 专门做毕设的网站深圳网站设计三把火