Skip to content

Different behavior when uploading a file with the same filename between v2 and v3 #2795

@xuuyswfaynvifuwm

Description

@xuuyswfaynvifuwm

In our system we rely on filenames to generate consistent download URLs from S3.

In Carrierwave v3 the deduplicate mechanism generates filenames suffix, and I understand that it's related to this change, but it breaks our system when upgrading to v3.

Expected behavior (as of v2.2.5):

  1. Upload dummy_file.pdf
  2. See dummy_file.pdf in S3 folder
  3. Re-upload dummy_file.pdf
  4. See dummy_file.pdf in S3 folder

Current behavior (v3.1.2):

  1. Upload dummy_file.pdf
  2. See dummy_file.pdf in S3 folder
  3. Re-upload dummy_file.pdf
  4. See dummy_file(2).pdf in S3 folder

We managed to implement a workaround in our system with this file uploader:

class FileUploader < CarrierWave::Uploader::Base 

  def deduplicated_filename
    filename
  end

end

Would it be possible to at least have an "overwrite" option that would rename the new file to match the expected filename ? That would be a step 6 in the process explained here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions