Comments (20)
It would be great if you could clarify in readme that using mount_base64_uploader
will not break mount_uploader
. Or some note that clarifies that this gem will allow to receive files by both an API and a form.
from carrierwave-base64.
Actually it already does that.
If it is not working for you, i would suggest you to check your form (i suppose you have two fields for the same property in one form, and the second one overrides the first one)
from carrierwave-base64.
Hm and I indeed thought that I had this working already some time ago, so I was surprised, too!
I will check again what you said. Thanks for the fast response!
from carrierwave-base64.
Okay, I tracked it down a little further:
- When creating a nested object, the upload using
input type="file"
works as expected - When creating a nested object, the upload using
textarea
and base64 string works as expected - When updating a nested object, the upload using
input type="file"
doesn't work - When updating a nested object, the upload using
textarea
and base64 string works as expected
Interestingly, the option to remove an existing file of a nested object doesn't work either, regardless of whether mount_uploader
or mount_base64_uploader
is used.
All this seems to be only the case on nested objects. Any idea? I will check out whether my test app from the last issue shows the same behaviour.
from carrierwave-base64.
The dummy app shows the same behaviour, I simply changed mount_uploader
to mount_base64_uploader
for both User
and Attachment
.
from carrierwave-base64.
Oh, it seems to have to do with something like in the last issue! When I only change the file field, then it doesn't have any effect on update. But if I also change another field (e.g. the name), it updates correctly!
from carrierwave-base64.
does the failure persist if you use the regular mount_uploader
?
from carrierwave-base64.
No, it only happens with mount_base64_uploader
. And it only happens for nested objects. You can try it in the test app.
from carrierwave-base64.
After a short investigation i found out, that the carrierwave
gem does not marks the attribute as changed for some reason.
So i think i could just mark the attribute as changed before calling the super method from the carrierwave
gem. But i'm not sure that this is correct.
from carrierwave-base64.
Thanks for investigating this. Should we propagate this issue on the carrierwave repo?
from carrierwave-base64.
Would you help me writing the description for the issue? I think you can do this much more precise than I can. I'm willing to write some passing/failing specs showing the problem, if needed, too.
Would be nice to have this issue created before end of the week, as I will be on holidays next week.
from carrierwave-base64.
I think i actually was wrong :(
Looks like the setter method from my gem overrides the method from the carrierwave, therefor it is not marking the attribute as changed for regular files. I'm sorry for any inconvenience, and i will make a quick in the next hour.
from carrierwave-base64.
Thanks, this is great to hear!
from carrierwave-base64.
So this should be fixed in version 2.1. Sorry again for the delay
from carrierwave-base64.
Nearly everything seems to work now, except one thing:
When updating a nested object, the upload textarea and base64 string doesn't work, as long as it's the only changed attribute
from carrierwave-base64.
That's strange. Was this working before?
from carrierwave-base64.
I can't say it. It sounds familiar, but I don't really remember.
from carrierwave-base64.
Pushed a new minor version. It should fix the mentioned problem
from carrierwave-base64.
Alright, it's working perfectly now! Thank you.
from carrierwave-base64.
@juanpastas yep, that's a good idea.
from carrierwave-base64.
Related Issues (20)
- Error: "ArgumentError : wrong number of arguments (given 1, expected 0)" HOT 4
- Avatar is not saving into database HOT 1
- Have to reload AR model when saving base64 photos. HOT 5
- Regression on 2.6.0 when passing base64 string HOT 5
- Support for multiple uploads ? HOT 4
- Permission denied @ unlink_internal - E:/project_name/public/uploads/1515432095-16344-0028-5553/video.mp4 HOT 1
- uninitialized constant CarrierWave::Mount (NameError) HOT 1
- "mount_base_64_uploader" method not recognized from rails console HOT 3
- issue with cloudinary gem integration HOT 1
- Validation fails on :file attribute HOT 4
- NoMethodError undefined method _will_change HOT 1
- Not able to nullify file field in 2.8.0 HOT 5
- When i supply base64 string it works but during update when the string is from the s3 image sets to nil HOT 3
- Wrong data format for automatic detection. `.ai`instead of `.pdf` HOT 3
- Save as JPG instead of PNG HOT 1
- Not working for multiple file upload HOT 1
- try to use carrierwave-base64 with nobrainer HOT 5
- depending on mimemagic, licensing problem with GPL HOT 13
- mimemagic dependency HOT 1
- NameError (uninitialized constant CarrierWave::MiniMagick::ImageProcessing): HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carrierwave-base64.