Rails 3.2 CarrierWave always saving image as open-uri -


i using rails 3.2.13 , carrierwave 0.9.0.

i extracting many pictures gem. i've succeed download these pictures, unfortunately name : "open-urixxxxxx".

i have original name of these pictures. have idea ?

here code in controller download picture :

var_bis = 'url' + line['illustration_url'] image_bis = open(var_bis) p.illustration.store!(image_bis) 

furthermore, have not changed original file of uploader except directory store. lot,

edit :

my uploader file :

class imageuploader < carrierwave::uploader::base   storage :file    def store_dir     "my_path_to_save_images"      end  end 

edit final :

here answer add in controller :

`f=open(file.basename(var_bis), 'wb')

f << open(var_bis).read

p.illustration.store!(f)`


Comments