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
isuue (stop downloading if file size is big) #371
Comments
AFAIK Formidable doesn't provide a way to stop the uploading process so req.connection.destroy() seems to be the only way around it for now. I'm currently using Node v6.0.0 and Formidable 1.0.17 and this is how I use it: |
Seems to be implemented as max file size option. Other part is in another request: #471 @NobodyLR, So if there is no other case for this, its going to be closed soon. |
i am using formidable to uplaod a file
i am setting a max file size
what i would like is to stop the uplaod if the file that i am expecting is too big
i am using this code but i dont like it its ugly
form.on('progress', function(bytesReceived, bytesExpected) {
if(bytesExpected/1024/1024>100)//100Mo
req.connection.destroy();
i am not using on('file) or the form.parse cuz the callback is executed after the file is uploaded
and this is what i dont like
the code that i am using does the trick but it makes an errer on the client side(angularjs)
if there is a way to stop the uplaod and send a json to the client
ty
The text was updated successfully, but these errors were encountered: