上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页

2022年2月7日

前端文件上传+expressJs后端文件写入

摘要: 多文件选择 <input type="file" multiple /> 下面以单文件为例 ###方式1:前端FormData + 后端multiparty 前端 //第一种:通过form表单 <form action="/" method="post" enctype="multipart/for 阅读全文

posted @ 2022-02-07 22:53 In-6026 阅读(137) 评论(0) 推荐(0)

2022年2月3日

URL.createObjectURL(File),URL.revokeObjectURL(url)

摘要: URL对象可以通过createObjectURL(any)方法来将任意内容any用一个地址来表示 栗子: <input type="file" id="F" /> let F = document.getElementById('F') F.onchange = function(event) { 阅读全文

posted @ 2022-02-03 17:51 In-6026 阅读(140) 评论(0) 推荐(0)

File,Blob,FileReader,ArrayBuffer,TypeArray,DataView

摘要: File就是用户计算机上的文件,一般通过<input type="file" />标签来使用户选择文件,选择后可以知道文件的大小,名称,类型等基础信息 File长这样,是个对象 Blob是Binary large Object缩写,人话:它是一个不可变的,包含二进制数据的,类文件对象(即:像是上面那 阅读全文

posted @ 2022-02-03 11:45 In-6026 阅读(96) 评论(0) 推荐(0)

(payload too large)expressJs上传文件大小受限解决方法

摘要: 安装第三方模块body-parser npm i body-parser 然后在app.js中 let bodyParser = require('body-parser') app.use(bodyParser.json({ limit: '2mb' }))//此处为2MB,可改 app.use( 阅读全文

posted @ 2022-02-03 10:58 In-6026 阅读(191) 评论(0) 推荐(0)

前端文件下载

摘要: ###a标签download属性实现下载 缺点:只能下载同一个ip,端口下的文件,不能跨域(不论被下载文件的后端允不允许跨域,都不行) <a download href="#"></a> ###后端实现,nodeJs的expressJs框架为例 访问该地址就会打开系统文件夹,提示下载,不会显示要下载 阅读全文

posted @ 2022-02-03 04:42 In-6026 阅读(70) 评论(0) 推荐(0)

2022年2月2日

File API FileReader与FileReaderSync

摘要: ###标签实现 <input type="file" id="files" /> ###获取被选择的文件的基础信息 |属性|作用| | | | |name|被选中文件的文件名| |size|文件大小(单位:字节byte)| |type|文件类型(image,text等)| |lastModified 阅读全文

posted @ 2022-02-02 07:22 In-6026 阅读(286) 评论(0) 推荐(0)

从0到1上线web项目全流程(和半仙君学的)

摘要: 购买云服务器 到云服务器控制台,根据服务器类型和项目要用到的语言(如node,php等),安装好需要的环境 打开远程连接 在本地写好项目 把项目压缩成.zip,上传项目.zip到云服务器 scp -r 项目 root@云服务器IP地址:/要上传到哪个目录 scp -r D://demo.zip ro 阅读全文

posted @ 2022-02-02 01:30 In-6026 阅读(64) 评论(0) 推荐(0)

2022年2月1日

String.at( -1 )类似于python

摘要: let str = '123456' console.log(str.at(-2)) //5 阅读全文

posted @ 2022-02-01 03:23 In-6026 阅读(45) 评论(0) 推荐(0)

Proxy,getter,setter

摘要: let person = { name: 'LLC' , gender: 'meal' } let proxy = new Proxy(person, { get() { console.log('get') return Reflect.get(...arguments) } , set() { 阅读全文

posted @ 2022-02-01 03:20 In-6026 阅读(44) 评论(0) 推荐(0)

2022年1月29日

单位——px,%,em,rem,vw,vh,vm,wmin,vmax

摘要: px 最常用,相对屏幕的分辨率而言的相对单位 % 一般相对父元素而言 em,rem em相对父元素的font-size rem相对根元素(html)的font-size vw,vh vw相对屏幕可视区域的宽度而言,若屏幕宽1000px则1vw=1000 / 100 = 10px vh相对屏幕可视区域 阅读全文

posted @ 2022-01-29 06:16 In-6026 阅读(320) 评论(0) 推荐(0)

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页

导航