I am fairly new to using carrierwave. Currently I can upload and perform simple actions on images, such as resize_to_fit.
Now I need to change my name-uploader.rb file, so when I upload a PDF file, it automatically converts the pdf to a multiple image files (PNG/JPEG). One main thing I want to understand is how can I check the type of the file uploaded? I know I can set a list of file types to be accepted, I have already set a list of accepted file-types.
Now when a pdf is uploaded I want it to be converted to multiple images, and for each image a new model is created with certain data and the image.
I have used the convert => "png"
, but it was giving me an error.
Note: I have included the RMagic is included at the top of the file.
Thanks,