js上传图片视频

<html>

<head>
    <style>
        .visually-hidden {
    
            position: absolute !important;
            height: 1px;
            width: 1px;
            overflow: hidden;
            clip: rect(1px, 1px, 1px, 1px);
        }

        /* Separate rule for compatibility, :focus-within is required on modern Firefox and Chrome */
        input.visually-hidden:focus+label {
    
            outline: thin dotted;
        }

        input.visually-hidden:focus-within+label {
    
            outline: thin dotted;
        }
    </style>
</head>

<body>
    <video src="blob:http://localhost:3333/b9106407-71f5-4329-b687-197549c18196" controls="controls"></video>
    <button onClick="sendFiles()">上传到服务器</button>
    <hr />

    <!-- 当用户选择一个文件时,handleFiles() 方法会用一个 FileList 对象作为参数被调用,FileList 对象包含表示用户选择的文件的 File 对象。如果你想让用户选择多个文件,只需在 input 元素上使用 multiple 属性: -->
    <input type="file" id="input" multiple onchange="handleFiles(this)">
    <hr />

    <p>通过 click() 方法使用隐藏的 file input 元素</p>
    <input type="file" id="fileElem" multiple accept="image/*" style="display:none" onchange="handleFiles(this.files)">
    <button id="fileSelect">Select some files</button>
    <hr />

    <p>使用 label 元素来触发一个隐藏的 file input 元素</p>
    <input type="file" id=
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

叶子 ✪ω✪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值