-
-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can the server automatically interrupt the file transfer? #456
Comments
我最近也有个需求是,在formidable把文件存储到临时目录之前先判断文件的类型,不符合要求就终止上传,例如可执行文件就不能让formidable存储到临时目录上,应该跟你描述的有相同之处,有解决方案吗? |
@DennisJames 我上面的代码就可以啊,这是我实际项目上传中的部分核心代码,可以限制上传的字节预期,文件数量,文件后缀名,文件数量,文件类型,文件大小, |
Seems to be related with this feature request #471. Can you confirm that? |
Try https://github.com/node-formidable/formidable/tree/filter-upload and use the filter function |
Now I have a need, that is, you want to limit the number of customer-side upload files.
Assuming the server now want to limit the client can only upload a file, then it is possible to detect the client is the time to upload the first two files on the initiative to interrupt transmission ? This is just an example, as well as a single file size limit, file type, file extension, etc.
I read the API seems to filter only some of the files, although not stored in the file, but the client actually upload the file stream.
I was wondering if it was possible to take the initiative to throw a bit off the
onprogress
,onfileBegin
,onfile
, etc. interrupts the transfer and called onerror.ps: Forgive me for not going to English, all Google Translate.
mart of my code:
The text was updated successfully, but these errors were encountered: