0

I'm using refile gem to upload multiple files to my S3 bucket through cloudfront CDN and it is woking just fine with standard file attachment field. But now I want to enhance front view experience by implementing drag and drop file JS library on front-end. For this I've chosen http://fineuploader.com/ and I've taken initial steps to integrate it with my view file.

However, now this plugin require us to specify the URL where it should send uploads and server requests to. This endpoint can be an absolute path or a relative path. More information could be found here: http://docs.fineuploader.com/quickstart/02-setting_options.html

But I'm not sure what endpoint this should be, considering I'm using Refile gem on server side for uploading.

Faisal Khurshid
  • 1,869
  • 3
  • 21
  • 27
  • I am facing similar problem with this plug-in. i am using `shrine` to upload images. how to integrate `fine_uploader` to `shrine`? any help would be appreciate +1 –  Aug 16 '16 at 12:53
  • What specific item are you struggling with? Uploads are to be sent to your S3 bucket URL. Server-side, you must sign the requests. – Ray Nicholus Aug 16 '16 at 15:18
  • I cannot upload files directly to my S3 bucket using fineuploader native method. It must go through refile gem regular process because after uploading the file the refile gem assign a unique string (i.e. ID) to refer to this file in future and this ID is saved in the database. More info on it can be found here: https://github.com/refile/refile#1-backend – Faisal Khurshid Aug 16 '16 at 15:42
  • Then you cannot use Fine Uploader S3. You must use Fine Uploader for traditional endpoints. Point `qq.FineUploader` at whatever endpoint you have for handling file uploads, and update it to return a JSON response with '"success": true" if the upload succeeds. – Ray Nicholus Aug 16 '16 at 16:49
  • Yes, I'm already using traditional method of fineuploader. But the issue is,in refile gem I don't see any endpoint mentioned in the gem docs, the gem covers the file uploading behind the scene and I'm not sure how to hook into refile gem native behavior and supply the files from fineuploader instead of regular file upload input field. – Faisal Khurshid Aug 16 '16 at 20:29
  • @Nani You might want to consider creating another topic because fineuploader integration with different rails gem might differ. Infact, I've checked shrine gem docs and it seems relatively easier to understand. Have a look at this section: https://github.com/janko-m/shrine#direct-uploads I might try this gem myself. – Faisal Khurshid Aug 16 '16 at 20:54
  • @MuhammadFaisal Shrine is easier for direct uploads. but i am using shrine with the help of jquery on front end to upload image_data. so i want to use `fine_uploader` as a frond end tool. because it has no dependency right? –  Aug 17 '16 at 07:25
  • 1
    @Nani Fineuploader has no dependency but it provides a jQuery version. I think we can upload files through shrine gem using direct-upload plugin as mentioned in the above link. I've opened up a ticket on shrine github page: https://github.com/janko-m/shrine/issues/76 – Faisal Khurshid Aug 17 '16 at 11:52

0 Answers0