Rails s3_direct_upload how to disable it

95 views Asked by At

In Rails, I am using s3_direct_upload gem for asset(doc file) upload. Right now if I try to upload an image file as a different asset, it is directly uploading to s3. I need to disable this option for image upload and it should be enable only for document upload.

1

There are 1 answers

1
ROR On

s3_direct_upload is provides form helper methods to upload images to s3 directly. like this s3_uploader_form. It just reduces your jquery_file_upload and s3 configuration.

But you can still upload image to your local file system. Using simple form_tag. i.e. When you want to upload images to s3 use s3_uploader_form syntax and when you want to upload images to local file system then use simple form_tag or any other rails provided form syntax.

For uploading images using ajax use remotipart gem with simple form syntax.