7

Is there a way to disable direct upload of images and attachments from the ActionText/Trix Editor and replace it with a POST request to the rails backend to do the upload to S3?

I'm trying to do this to audit any user upload actions from Rails application standpoint.

Updates: I'm thinking I can probably extend the ActiveStorage::DirectUploadsController to do this audit. I'm still curious about the original question.

I'm also thinking about writing javascript to change data attribute (data-direct-upload-url) of <trix-editor> html form element.

konyak
  • 10,818
  • 4
  • 59
  • 65
  • 1
    I realize that I am a little late to the game, but what did you end up doing to work around this? We have our storage service on a private network which doesn't work with direct uploads. – krsyoung Jun 12 '21 at 02:18
  • 1
    I think I kept the direct upload and did audit another way. You can change ActiveStorage config to point to your private network. – konyak Jun 14 '21 at 01:01
  • We're having a heck of a time figuring out the ActionText piece (drag and drop is wonderful but very much wants to direct upload - which seems to always require direct access to the storage service). The ActiveStorage proxy config helped a lot with the downloads but uploads via ActionText/Trix always reference the public (and thus not accessible) Azure storage endpoint. – krsyoung Jun 15 '21 at 04:01

0 Answers0