Skip to content
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

Support for multipart/form-data #394

Open
PedroAugustoRamalhoDuarte opened this issue Oct 13, 2023 · 1 comment
Open

Support for multipart/form-data #394

PedroAugustoRamalhoDuarte opened this issue Oct 13, 2023 · 1 comment

Comments

@PedroAugustoRamalhoDuarte

First of all, thanks for this gem it helps a lot.

Problem

I encountered a challenge while attempting to integrate this gem with another Rails application that utilizes Active Storage. My objective was to send files, but upon inspecting the source code and conducting some research, I discovered that there is currently no direct method to achieve this.

Desired API:

Media.create!(name: "Teste",
              media_type: "book",
              file: File.new("test/fixtures/files/test.txt"))

I noticed that there is a format option available for overriding, but it isn't sufficient for sending a multipart request with Net::HTTP. I started working on implementing this feature, but it seems like it would require a significant refactoring effort to make it functional. I'm curious to know your thoughts on whether it would be appropriate to add this functionality directly to this gem, or perhaps consider it as a feature in another gem as a plugin.

@rafaelfranca
Copy link
Member

I'd be happy with a PR, but we have no plans to work ourselves to implement new feature on this gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants