原生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