Question: How to conditionally override `resource_type`?
@const-cloudinary arbeitet bereits daran.
Seit 23.3.2021.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Is it possible to conditionally set resource_type to "raw" based on attributes of the model instance?
The issue I'm facing is that I have users who want to upload password-protected PDFs. These get rejected by Cloudinary with an error.
In order to upload these, it seems like I need to set the resource_type to "raw", overriding the auto-identified file type (pdf):
- https://support.cloudinary.com/hc/en-us/community/posts/360007080219-Encrypted-PDF-file-upload-error
- https://github.com/cloudinary/cloudinary_gem/issues/85
- https://github.com/cloudinary/cloudinary_gem/issues/17#issuecomment-17277801
The only way I've found so far to do that is with a transformation in the uploader class:
process cloudinary_transformation resource_type: "raw"
...which works, but applies to all files uploaded with this uploader, since process is a class method (?).
Is it possible to set resource_type dynamically for each uploaded file? Or is the approach to have two different uploaders: one which obeys the MIME type (?) and another which always uses "raw"?
If the approach is multiple uploads, is it possible to switch those based on data in the model, or is there always just one uploader per model? I guess that's maybe a question for the CarrierWave project.
Many thanks for your patience 🙏 - I'm inheriting a legacy project which is using this gem and I'm only just getting to grips with how it works 😅
- Vorherrschende Sprache
- Ruby
- Sterne
- 420
- Forks
- 282
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudinary/cloudinary_gem
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
cloudinary/cloudinary_gem#597 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 52/100
cloudinary/cloudinary_gem#591 · 3 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
cloudinary/cloudinary_gem#582 · 1 Kommentar ·
-
404's when fetching .eml files (from Action Mailbox)Evtl. wieder frei @rnamba-cloudinary hat das vor 400 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
cloudinary/cloudinary_gem#581 · 1 Kommentar ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleEvtl. wieder frei @const-cloudinary hat das vor 541 Tagen übernommen, und es ist kein Pull Request offen. Offen
cloudinary/cloudinary_gem#573 · 3 Kommentare · 1 zugewiesene Person ·
Alle Issues in cloudinary/cloudinary_gem
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
metacall/core#964 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: ci benchmark build developer-experience difficulty: easy dx enhancement github-actions good first issue hacktoberfest help wanted performance quality rank: 8 kyu ruby tech: ruby
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Huerte/algo-solutions-python#260 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag