chunkUploads: true + server side validation #43
Replies: 2 comments
-
@bjornbjorn, yes, this is something you cannot have total control over. This is the reason why I came up with controller/request level validation, see here. So whatever the user may try to upload, you can have a clear concise validation before allow moving the files to permanent storage.
This is something maybe possible but there'll be gotchas. Some may set third party storage as temporary storage. Also, current version of filepond doesn't have any way to show validation error during chunk upload requests. I'll have a look but can't confirm anything right now. Hope this clears up my design decisions. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Rahul, thanks for getting back to me, and also thank you for releasing this excellent laravel-filepond package :-) Yup, I understand. So, currently I'm leaning towards client side validation which will catch stuff for regular users and then maybe do the final validation in the processing where the files are moved from temp storage (fileponds) to permanent storage. |
Beta Was this translation helpful? Give feedback.
-
The validation examples in the README doesn't work in combination with chunked uploads, since the initial POST request doesn't actually include the file, but rather is it posted in subsequent PATCH requests.
Not sure what the best route is for validation here - I guess one could check the initial
upload-length
header for file size validation, but one cannot ensure that this is correct, someone might spoof that.So the only option might be to do this in the final PATCH call, when combining all chunks to a file.
Same goes for extension or mime-type validation I guess.
Anyone have thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions