New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveStorage direct uploads can't specify a service_name? #38940
Comments
Hi @scottjg! I've reproduced the issue and investigating, thanks for catching that! |
as a temporary workaround for my app, i implemented my own controller/route for direct uploads: class DirectVideoUploadsController < ActiveStorage::DirectUploadsController
private
def blob_args
super.merge({
service_name: Rails.env.production? ? :aws_video_input : :aws_video_input_dev,
})
end
end |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
#38957 was never merged, so this is still an issue. |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
it's still an issue |
This issue has been automatically marked as stale because it has not been commented on for at least three months. |
still not fixed |
Still an issue unfortunately |
Still an issue |
#38957 is the relevant PR |
Closed by #38957 |
It appears the referenced PR was reverted. Was a different fix applied? |
Ack, I didn't read the thread fully, thank you |
hey @DmitryTsepelev -- I brought my app to rails master, so that i could try out your PR: #34935
unfortunately, I can't seem to figure out how direct uploads can respect the service specified in the model?
DirectUploadsController
doesn't seem to allow passing in a service (though I'm not sure you'd want that to be user controlled necessarily?). I was expecting somehow for the rails form helpers to somehow signal to theDirectUploadsController
what service to use, based on the model it was posting to.I'm assuming I'm just missing something, but it seems like there might not be a way to use direct uploads with your PR changes? I guess you could write your own
DirectUploadsController
?Steps to reproduce
use a
form_with
in your erb that points to a model, make a file field the same name as ahas_one_attached
field anddirect_upload: true
. then upload a file via your web browserExpected behavior
direct upload will be directed at the service specified in the model
Actual behavior
direct upload goes to the default storage adapter
System configuration
Rails version: c1ccc6a0d240
Ruby version: 2.5.1p7
The text was updated successfully, but these errors were encountered: