As described in #72, an upload that has a size that is an exact multiple of the upload chunk size set on the filepond client configuration results in the upload of an empty final chunk.
Previously this was not handled correctly since as soon as django-drf-filepond detects that the amount of data received for an upload is equal to the data size specified in the upload headers, it goes ahead and processes the uploaded chunks, converting them to the full file and storing this as a TemporaryUpload object. The database record created to track the chunks being uploaded is then removed. When the final chunk upload comes in with no data, it doesn't match a TemporaryUploadChunked object so the PATCH request fails and the upload on the client side then fails too.
This has been addressed by checking if a PATCH request has no data. If that's the case, the headers are checked to verify that the request relates to an upload where all data has already been transferred and if that's the case, the request is accepted. The upload then completes successfully on the client side.
As described in #72, an upload that has a size that is an exact multiple of the upload chunk size set on the filepond client configuration results in the upload of an empty final chunk.
Previously this was not handled correctly since as soon as django-drf-filepond detects that the amount of data received for an upload is equal to the data size specified in the upload headers, it goes ahead and processes the uploaded chunks, converting them to the full file and storing this as a
TemporaryUpload
object. The database record created to track the chunks being uploaded is then removed. When the final chunk upload comes in with no data, it doesn't match aTemporaryUploadChunked
object so thePATCH
request fails and the upload on the client side then fails too.This has been addressed by checking if a
PATCH
request has no data. If that's the case, the headers are checked to verify that the request relates to an upload where all data has already been transferred and if that's the case, the request is accepted. The upload then completes successfully on the client side.