Carrierwave - "uploading" a file from a string

Viewed 3216

Users in my site can upload their own photos for a model or choose from a library. When the users choose from the library I send the file name as a string to the server {file: {url: 'url.jpg'}}. I haven't find a way in which carrierwave can just update a model file without uploading it. I can write a condition in my model that checks for the existence of that parameter and then model.file = File.open('str.jpg'). Is that bad from a security view? How can I "upload" files, or just update the file attribute, to reference a file that's already available on the server?

Thanks!

2 Answers
Related