You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the JavaScript client to upload a binary file to a deal, the file gets corrupted. I see that issue #5 (which is closed) explains a fix was to use the file_path property. However, this only works for plain text files for me. When I use a binary file, I get the behavior that @alexandremaeda mentioned in #5.
Ultimately, I had to bypass using the JavaScript client completely and go straight to the API. I looked at how the Pipedrive web app did file uploads and saw that it used the form-data library. The gist below shows my solution using form-data. Because this solution deviates from the typical pattern in the JavaScript client for sending requests to the API, I did not create a pull request.
.. but result in UI is not viewable and compared to uploading same file through UI, they differ in filesize. Apparently the problem is in how data is embedded into multipart handler and how content-length is calculated
When I use the JavaScript client to upload a binary file to a deal, the file gets corrupted. I see that issue #5 (which is closed) explains a fix was to use the
file_path
property. However, this only works for plain text files for me. When I use a binary file, I get the behavior that @alexandremaeda mentioned in #5.Ultimately, I had to bypass using the JavaScript client completely and go straight to the API. I looked at how the Pipedrive web app did file uploads and saw that it used the
form-data
library. The gist below shows my solution usingform-data
. Because this solution deviates from the typical pattern in the JavaScript client for sending requests to the API, I did not create a pull request.https://gist.github.com/scottsbaldwin/230465d8d90c9e05b37535dbc723c7ac
Could something like this be adapted to work in the API?
The text was updated successfully, but these errors were encountered: