Using aspose add on
I'm using cloudinary to allow users to upload files with many different extensions from .docs and .pdfs to .jpgs and .pngs, so i decided to use the aspose add on. However, I am having an issue with allowing users to upload the different files with the same uploader.
I'm using client side uploading with carreierwave in Ruby on Rails, so i have
<%= f.cl_image_upload(:attachment, allowed_formats:["jpg", "jpeg", "pdf", "png", "doc", "docx"], :resource_type => 'auto', :raw_convert => 'aspose') %>
to allow users to attach their files.
However, when the user uploads an image or a pdf(files which arent raw and doesnt need conversion with aspose) i get a 500 error saying that the file type is not supported by aspose. Therefore, i am forced to have two uploaders, one for images and pdfs and another for raw files, which is not good in terms of user experience.
So, i was wondering if there was a way to automatically detect if its a raw file or not, and only call :raw_convert => 'aspose' when its a raw file.
-
To further clarify, right now I have two image uploaders like this:
<%= f.cl_image_upload(:attachment, allowed_formats:["jpg", "jpeg", "pdf", "png", "doc", "docx"], :resource_type => 'auto') %>
<%= f.cl_image_upload(:attachment, allowed_formats:["jpg", "jpeg", "pdf", "png", "doc", "docx"], :resource_type => 'auto', :raw_convert => 'aspose') %>
the first one to support non-raw files and second for raw files, but I would like to have just a single uploader that can detect if its a raw file and call aspose conversion when appropriate
0 -
Thank you for reporting about this.
Our team is taking a deeper look at this issue. We'll let you know of any updates.
Thanks.0
Post is closed for comments.
Comments
2 comments