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
Version 3.0.0 deduplicates file names even when not needed #2670
Comments
We got a very similar issue, when we reupload a file with an identical name, the saved file has duplicate name (eg |
Thank you for reporting. This should be fixed by b732acd, so please try. |
Hi, in my uploader i've got the same issue. My Carrierwave version is (3.0.7) and i using class BaseUploader < CarrierWave::Uploader::Base
if Rails.env.in? %w[production blue staging]
storage :fog
else
storage :file
end
def store_dir
if Rails.env.production? || Rails.env.blue?
"uploads/#{model.class.to_s.underscore}/#{model.id}"
else
"uploads-#{Rails.env}/#{model.class.to_s.underscore}/#{model.id}"
end
end
end class CertificateUploader < BaseUploader
def filename
'certificate.pdf'
end
end The first time i try generate a new certificate, work's like a charm, but, if i retry to generate a new certificate file |
@GabrielKoehler Yours should be unrelated to this, and is expected. See #2712 (comment) for reasoning. |
In our application we have an uploader set up like the following:
which stores file attachments in a separate sub-folder for each record (notice
#{model.id}
at the end of the path).When we duplicate a record that has an attachment with
dup
, we've noticed that the duplicated record attachment gets the suffix added to the filename, even though it's stored in a different folder compared to the original one and therefore there's no need to add the suffix.If we force the uploader not to deduplicate filenames by overriding the following function (which admittedly looks a bit hacky and we'd rather not do that):
the issue disappears.
The text was updated successfully, but these errors were encountered: