Question: How to conditionally override `resource_type`?
@const-cloudinary ci sta già lavorando.
Dal 23/3/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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 😅
- Lingua principale
- Ruby
- Stelle
- 420
- Fork
- 282
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudinary/cloudinary_gem
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
cloudinary/cloudinary_gem#597 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
cloudinary/cloudinary_gem#591 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
cloudinary/cloudinary_gem#582 · 1 commento ·
-
404's when fetching .eml files (from Action Mailbox)Forse di nuovo libera @rnamba-cloudinary l’ha presa 400 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
cloudinary/cloudinary_gem#581 · 1 commento ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleForse di nuovo libera @const-cloudinary l’ha presa 541 giorni fa e non c’è nessuna pull request aperta. Aperta
cloudinary/cloudinary_gem#573 · 3 commenti · 1 assegnatario ·
Tutte le issue di cloudinary/cloudinary_gem
Issue simili
-
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
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
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
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Huerte/algo-solutions-python#260 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
internal
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Kong/developer.konghq.com#8080 ·
I maintainer di solito rispondono entro 1 giorno