Closed Baaboud closed 8 months ago
issue
we get error when there is an empty file is uploaded the issue happens in the decode process for data part because it is empty
lib/active_storage_support/base64_attach.rb:22 decoded_data = Base64.decode64(data) here the data is nil and will get an error
lib/active_storage_support/base64_attach.rb:22 decoded_data = Base64.decode64(data)
nil
I think we should consider allowing empty data part to be blank like I did in my PR here or adding validation to allow or prevent empty files
@Baaboud thanks for the PR. Can you add a test so we prevent regressions?
Summary
issue
we get error when there is an empty file is uploaded the issue happens in the decode process for data part because it is empty
lib/active_storage_support/base64_attach.rb:22 decoded_data = Base64.decode64(data)
here the data isnil
and will get an errorOther Information
I think we should consider allowing empty data part to be blank like I did in my PR here or adding validation to allow or prevent empty files