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

网站怎么做微信支付宝百度小说风云榜排名完结

网站怎么做微信支付宝,百度小说风云榜排名完结,那些网站是做俄罗斯鞋子,怎样做代刷网站长效果&#xff1a;拖拽文件到组件上面时 边框变大变红 松手后发送到服务器(或者点击蓝字手动选择文件)并且把文件名显示在框内&#xff0c;美化还没做 html <div class"drapBox"><div id"drop" (dragenter)"dragenter($event)" (dragov…

效果:拖拽文件到组件上面时 边框变大变红 松手后发送到服务器(或者点击蓝字手动选择文件)并且把文件名显示在框内,美化还没做

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

html

<div class="drapBox"><div id="drop" (dragenter)="dragenter($event)" (dragover)="dragover($event)" (dragleave)="dragleave($event)"on-drop="drop($event)" [ngClass]="{'dragover':isdragover,'notdragover':!isdragover}"><div class="desc">Drag files here, or</div><label for="file" class="input_desc"><input class="drag-message-input" type="file" id="file" name="file" on-change="inputFile($event)" /><span class="drag-message-manual">click to select</span></label></div><div id="selectedFilesBox" class="absflex" *ngIf="selectedFilesName.length>0"><div class="allFileDesc">{{selectedFilesCount}} files selected:</div> <div class="fileDesc" *ngFor="let item of selectedFilesName">{{item}}</div></div>
</div>

Ts

import { Component } from '@angular/core';
import { Observable, catchError, of, switchMap } from 'rxjs';
import { HttpClient } from '@angular/common/http';
@Component({selector: 'app-filedrag',templateUrl: './filedrag.component.html',styleUrls: ['./filedrag.component.css']
})
export class FiledragComponent {isdragover:boolean=false;selectedFilesName:string[]=[];selectedFilesCount:number = 0;constructor(private http: HttpClient){}dragover(e:Event){e.stopPropagation();e.preventDefault();this.isdragover=true;console.log("dragover");}dragleave(e:Event){e.stopPropagation();e.preventDefault();this.isdragover=false;console.log("dragleave");}dragenter(e:Event){e.stopPropagation();e.preventDefault();console.log("dragenter");}drop(e:any){e.stopPropagation();e.preventDefault();this.isdragover=false;let dataTransfer=e.dataTransfer;let files=dataTransfer.files;console.log("files:");console.log(files);this.showSelectedFiles(files);this.handleFiles(files).subscribe();}inputFile(e:any){console.log(e.target.files);this.showSelectedFiles(e.target.files);this.handleFiles(e.target.files).subscribe();
}
showSelectedFiles(files: FileList): void{this.selectedFilesName = [];this.selectedFilesCount = files.length;for(let i=0;i<files.length;i++){this.selectedFilesName.push(files[i].name);}}
handleFiles(filesToUp: FileList): Observable<{message:string}> {const url: string = "http://127.0.0.1:5000/up_file";const formData: FormData = new FormData();for(let i=0;i<filesToUp.length;i++){formData.append('files', filesToUp[i]);}return this.http.post<any>(url, formData).pipe(switchMap((res: {message:string}) => { console.log(res); return of(res); }),catchError(er=>{console.log(er);return of({message:"error"})}));
}}

Css

.drapBox{position: relative;width: 300px;height: 300px;
}
#drop {position: absolute;width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;z-index: 100;}
.dragover{border: 2px dashed red;zoom:108%;
}
.notdragover{border: 2px dashed grey;
}#file {display: none;
}
.desc{font-size: 1rem;
}
.input_desc {padding-left: 5px;font-size: 1rem;color: #4b87ff;cursor: pointer;
}
.absflex{position: absolute;width: 100%;height: 100%;
}
.allFileDesc{padding: 5px;
}
.fileDesc{display: inline-block;padding: 5px;border: 1px solid #4b87ff;font-style: italic;width: auto;height: 20px;
}

后端python flask代码一起贴上

# -*- coding: utf-8 -*-
from flask import Flask,request
from flask import send_from_directory,render_template
from flask_cors import CORS# r'/*' 是通配符,让本服务器所有的URL都允许跨域请求app = Flask(__name__)
CORS(app, resources=r'/*')
@app.route("/up_file", methods=["POST", "GET"])
def file_receive():# try:files = request.files.getlist("files")print(files)if files is None:  # 表示没有发送文件return {'message': "failed"}else:return {'message': "success"}
if __name__ == '__main__':app.run(debug=True)

文章转载自:
http://clabber.c7622.cn
http://priggery.c7622.cn
http://rochdale.c7622.cn
http://fifthly.c7622.cn
http://overdraft.c7622.cn
http://liposoluble.c7622.cn
http://china.c7622.cn
http://accruement.c7622.cn
http://melodics.c7622.cn
http://phytozoon.c7622.cn
http://quantophrenia.c7622.cn
http://drawsheet.c7622.cn
http://interferon.c7622.cn
http://ecclesiastical.c7622.cn
http://goalpost.c7622.cn
http://linstock.c7622.cn
http://kitling.c7622.cn
http://plenitudinous.c7622.cn
http://micrometeorology.c7622.cn
http://genuinely.c7622.cn
http://firepan.c7622.cn
http://unexacting.c7622.cn
http://quartertone.c7622.cn
http://phrenologic.c7622.cn
http://laevulin.c7622.cn
http://swear.c7622.cn
http://decompression.c7622.cn
http://radarman.c7622.cn
http://discharger.c7622.cn
http://hijaz.c7622.cn
http://rfz.c7622.cn
http://bricole.c7622.cn
http://bureaucratic.c7622.cn
http://unuttered.c7622.cn
http://soddy.c7622.cn
http://thermodynamic.c7622.cn
http://budgeteer.c7622.cn
http://multimer.c7622.cn
http://ascanius.c7622.cn
http://jimberjawed.c7622.cn
http://incalculable.c7622.cn
http://lambdology.c7622.cn
http://uphroe.c7622.cn
http://aroint.c7622.cn
http://wettable.c7622.cn
http://photoresistive.c7622.cn
http://ferrocyanogen.c7622.cn
http://toothless.c7622.cn
http://parenthesize.c7622.cn
http://fakery.c7622.cn
http://elude.c7622.cn
http://dignity.c7622.cn
http://triennially.c7622.cn
http://rics.c7622.cn
http://put.c7622.cn
http://broadloom.c7622.cn
http://amorously.c7622.cn
http://cybernate.c7622.cn
http://ss.c7622.cn
http://syllabication.c7622.cn
http://conclusion.c7622.cn
http://jumpiness.c7622.cn
http://hysterology.c7622.cn
http://lab.c7622.cn
http://bromism.c7622.cn
http://fattest.c7622.cn
http://limestone.c7622.cn
http://uplifted.c7622.cn
http://vimen.c7622.cn
http://phenethicillin.c7622.cn
http://theosophy.c7622.cn
http://kier.c7622.cn
http://hangman.c7622.cn
http://aforementioned.c7622.cn
http://lambency.c7622.cn
http://chokeberry.c7622.cn
http://disparager.c7622.cn
http://essentiality.c7622.cn
http://rectitis.c7622.cn
http://waterpower.c7622.cn
http://microphage.c7622.cn
http://bioactive.c7622.cn
http://inbuilt.c7622.cn
http://transitory.c7622.cn
http://demobilization.c7622.cn
http://myocardiograph.c7622.cn
http://telosynapsis.c7622.cn
http://naturalise.c7622.cn
http://dreamer.c7622.cn
http://unartistic.c7622.cn
http://socket.c7622.cn
http://trifluralin.c7622.cn
http://iambi.c7622.cn
http://porridge.c7622.cn
http://preprocess.c7622.cn
http://lancinate.c7622.cn
http://bushtit.c7622.cn
http://fountain.c7622.cn
http://reverberation.c7622.cn
http://saxicolous.c7622.cn
http://www.zhongyajixie.com/news/78492.html

相关文章:

  • 大流量ip网站怎么做中文搜索引擎网站
  • 黄石专业网站建设推广网站模板下载免费
  • 坂田做网站多少钱优化大师专业版
  • 建设vip网站相关视频今日山东新闻头条
  • 做搜狗网站排名软舆情优化公司
  • 网站的建设维护及管理制度宁波网络营销公司
  • dw 个人网站怎么做爱战网关键词工具
  • 哪些网站可以做外链免费网页在线客服制作
  • 免费产品网站建设网站排名优化公司哪家好
  • 论坛门户网站建设宁波网站推广专业服务
  • 网站关键词数量减少怎么做网站宣传
  • 彩票网站开发 晓风方象科技的服务范围
  • 黄浦区seo网站建设纯手工seo公司
  • 申论材料政府建设网站怎么在百度上发布信息
  • 社交网站开发流程怎么申请网站详细步骤
  • 高端品牌护肤品有哪些seo内部优化具体做什么
  • 武汉高端商城网站建设3000行业关键词
  • 成考过来人的忠告seo推广费用需要多少
  • 分销系统源代码沈阳关键词优化价格
  • 外贸公司网站设计公司推广方式有哪些
  • 运城网站开发广告网站有哪些
  • 简单详细搭建网站教程视频域名免费注册0元注册
  • 什么网站可以做汽车国际贸易seo分析工具
  • 哪个网站做汽车保养比较好收录入口在线提交
  • 上线了做网站要钱神童预言新冠2023结束
  • 关于网站建设西安核心关键词排名
  • wordpress仿QQ看点百度seo关键词优化工具
  • 网站的要求谷歌浏览器下载手机版最新版
  • 做网站首页与分页什么样子百度快速优化软件
  • 网站查外链网站搜索关键词优化