Comments (4)
2.3.3 加了一个 catch
from upload.
具体场景列一下,我感觉最好在 Promise 里面直接处理异常吧。不是很清楚为什么一定要在组件里面处理业务异常。
from upload.
@shepherdwind
我要实现的功能是: 在图片上传之前对file进行压缩处理,并对选择的文件进行筛选
代码如下:
这是 beforeUpload 函数,
我已经用 try catch进行了异常处理,并且在catch里面捕获到了异常,但是上图代码会出现下面的情况:
虽然捕获到了异常,但是 还是上传了这个mp4文件;
只有在catch里面继续抛出异常才能终止这个文件的上传...不知道什么情况?
from upload.
哦,我知道了,这里处理是有问题。
from upload.
Related Issues (20)
- 拖拽上传无法禁用文件夹
- 选300多张图片的时候非常卡,而且canvas会创建出20000+个
- Parsed File shape is incorrect on certain platforms HOT 1
- Feature Request: Choose and Upload later
- Android手机无法选择视频上传
- Typescript: make arguments optional
- duplicated parameter: capture
- Feature request: re-upload trigger
- Coding
- return U-Id don't accepted in file preview
- How to trigger upload from external button element HOT 1
- upload组件的method是不是没什么意义,改put也不能有效上传form-data格式的数据
- 拖拽上传含有多个文件的文件夹时,beforeUpload无法获取全部文件,点击上传时可以,这是bug吗?
- chrome最新版本点击无效(无法唤起文件选择) HOT 1
- disabled属性需要作用到input上
- Clock pyrhon
- Support directory AND file uploads via Drag-and-Drop HOT 1
- upload a directory which size is very bigger(above 100G), this component will make the chrome memory usage to exceed 2G, and the crash
- 开启文件夹上传时就不能多选文件上传,可以解决吗? HOT 1
- 4.3.6版本 更改了内部的 click 事件导致生产报错了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upload.