-
Notifications
You must be signed in to change notification settings - Fork 964
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
Multipart: PDF file is uploading corruptedly #689
Comments
By the way, here is the information about each gem. HTTParty: * httparty (0.18.0)
Summary: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage: https://github.com/jnunemaker/httparty
Path: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/httparty-0.18.0 RestClient: * rest-client (2.1.0)
Summary: Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.
Homepage: https://github.com/rest-client/rest-client
Path: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rest-client-2.1.0-x64-mingw32 |
Thanks for reporting! |
Any file. The following is the content of the damaged file opened with Notepad++:
|
Does this mean we should not use Httpaty gem for file uploads and opt for RestClient instead. Thanks @lflucasferreira for raising this issue. Love the gem! |
@lflucasferreira Sorry for a late reply. |
I am having the same issue using HTTParty 0.18.0 |
@alexhill113 @lflucasferreira this is super weird. As I can't confirm the issue. Can you, please, help me out in this? Can you check this versions of httparty and see if the issue is reproduced?
If it is reproduced everywhere could you create a simple repository with server, upload script and file where this issue is reproduced. I know that's a lot to ask, but I really want to fix this and can't do that without your help |
Wow.. spent good day on this. Mine is not a pdf but an image. |
What I think the problem is, we are trying to upload huge file and httparty 'stops' prematurely. Even though I added the timeout: blah, still doesnt work well. |
@TheSmartnik, owing to the pandemic I am not working at the office and I am on vacation. Once I get back, I will test older versions. |
Hi there!
I would like your help in order to find a solution to my problem, if possible.
Below is the code I am trying to make as a multipart/form-data request. The file is sent to the server, but it is always corrupted. But when I use the gem RestClient (the second code below), it works fine.
So, I believe there is an error, or with my code, or with the HTTParty gem.
HTTParty code:
RestClient code (obs: another class file):
Please, I would like to keep using HTTParty as my main REST API library. I do not like mixing gems.
Thank you in advance! :)
The text was updated successfully, but these errors were encountered: