Currently facing an issue with Filepicker's iframe in my application... my tools:
- Framework: Rails 4 (including turbolinks)
- API: Filepicker.io (JS)
- File type: Coffeescript
My sample code:
ready = ->
filepicker_api_key = $js_data.data('filepickerApiKey')
unprocessed_path = $js_data.data('unprocessedPath')
filepicker.setKey(filepicker_api_key)
$('#image-upload').click (e) ->
picker_options =
services: ['COMPUTER']
mimetypes: ['image/*']
store_options =
location: 's3'
path: unprocessed_path
access: 'public'
filepicker.pickAndStore picker_options, store_options ->
console.log 'foobar'
# alot of code comes here.. which works whenever I refresh the page
$(document).ready(ready)
$(document).on('page:load', ready)
It stops once I try uploading something. My logs show this error:
Error: Permission denied to access property 'filepicker_comm_iframe'
and doesn't show my 'foobar'
log
But when I refresh the page, I receive no error, and the file uploads accordingly. I am trying to avoid the flaw of having to refresh the page in order to upload successfully.