Episodes
Jayzen said over 4 years ago on SimpleMDE and ActiveStorage :
great video ~ can you show the way to upload picture by the icon(not link but upload img from local)

Simon Kiteley PRO said over 4 years ago on SimpleMDE and ActiveStorage :
Found I had an issue when storing to Amazon S3 that link used times out, I believe. Would you have an idea how to fix this?

David Kimura PRO said over 4 years ago on SimpleMDE and ActiveStorage :
I believe that this is caused by the `url_for` which creates the `presigned_key` URL and has a 5 minute default expiration. You could instead of the JSON response of the direct URL, you send the response back which goes to the SHOW action of the ArticleImage. The show action will get the record and redirect to the S3 link from the `url_for`. This could have the added benefit of checking authorization/authentication of the image about to be displayed to a user. This would also solve the expiration time as it would generate a new link. You could also wrap the `url_for` with a `Rails.cache.fetch` and set the expiration to 5 minutes to prevent the overhead of having to get another signed url for every request of the same image within the given interval.

Simon Kiteley PRO said over 4 years ago on SimpleMDE and ActiveStorage :
Brilliant, thanks for that. Not sure about a couple of the steps you mention but sure a google search will provide lol.

David Kimura PRO said over 4 years ago on SimpleMDE and ActiveStorage :
I'm interested in this as well. I'll do some research and will probably write up a blog article about it. If I had to guess, it will be removing the default image button and making a custom button which mimics the Drag/Drop functionality.

Login to Comment