原生input上传视拼,参数形式 file: (binary)形式的


<input type="file" @change="demo">

if(e.target.files[0]&&e.target.files[0].type.indexOf("mp4")!=-1){//检查视频
	console.log("e",e.target.files[0].type);//这个就是binary流

        //接口
	fileUpload({
	// 转换为
	file: e.target.files[0]
	}).then(res=>{
		if( res.success==true){
			// console.log(res);
			this.getterVideohttp(res.data);
			this.videoPass=res.data;
		}
	})
}else{
	this.$notify({
		message: "请上传video/mp4",
		type: 'success',
		duration: 1500
	})
	return
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM