Question: How to conditionally override `resource_type`?
@const-cloudinary ya está trabajando en esto.
Desde el 23/3/2021.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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 😅
- Lenguaje dominante
- Ruby
- Estrellas
- 420
- Forks
- 282
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudinary/cloudinary_gem
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
cloudinary/cloudinary_gem#597 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
cloudinary/cloudinary_gem#591 · 3 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
cloudinary/cloudinary_gem#582 · 1 comentario ·
-
404's when fetching .eml files (from Action Mailbox)Quizá libre de nuevo @rnamba-cloudinary la tomó hace 400 días y no hay ningún pull request abierto. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
cloudinary/cloudinary_gem#581 · 1 comentario ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleQuizá libre de nuevo @const-cloudinary la tomó hace 541 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary_gem#573 · 3 comentarios · 1 asignado ·
Todos los issues de cloudinary/cloudinary_gem
Issues similares
-
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
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
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
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Huerte/algo-solutions-python#260 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
internal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Kong/developer.konghq.com#8080 ·
Los mantenedores suelen responder en 1 día