Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Preserve original filename on UploadedFiles #96

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

emilong
Copy link
Contributor

@emilong emilong commented Sep 7, 2018

We have the original file name for uploaded files, so this commit changes uploading to pass this information to the API for better metadata. Without this change, files show up as RackMultipart20180907-5692-1217313.pdf for example. 馃槄

@jyoung488
Copy link
Contributor

Thanks @emilong! This may already be addressed in v3.7.2 actually!

@emilong
Copy link
Contributor Author

emilong commented Sep 11, 2018

Hmm... I just tried with 3.7.2 and I still got a RackMultipart filename. Do I need to invoke differently? I'm using it with update_template_files like this:

files = params.require(:files) # array of ActionDispatch::Http::UploadedFiles

response = HelloSign.client.update_template_files(
  template_id: source_hellosign_template_id,
  files: files
)

@jyoung488
Copy link
Contributor

My apologies - I read this wrong the first time and was thinking about the downloaded filenames. I will review if GitHub behaves today! :)

@emilong
Copy link
Contributor Author

emilong commented Sep 11, 2018

Thanks! If it's helpful, this is the part of the multipart-post API I'm trying to use: https://www.rubydoc.info/gems/multipart-post/2.0.0/UploadIO:original_filename

@jyoung488
Copy link
Contributor

@emilong Strange, I can't seem to recreate it still! Do you mind sending over how you're initializing the ActionDispatch::Http::UploadedFiles class? I'd like to recreate on my end as well. You can send it over to apisupport@hellosign.com so we can continue to the conversation there. Thank you!

@emilong
Copy link
Contributor Author

emilong commented Sep 11, 2018

My example was deep inside our app, but I was able to create a sample app that does the same thing. Here's the commit that shows the usage - https://github.com/binti-family/hellosign-example/commit/e1129af06c458f5b903b36dedc894f981dfdc3d0

HTH! 馃槃

@jyoung488
Copy link
Contributor

@emilong thank you so much for all your help!

@jyoung488 jyoung488 merged commit 333a705 into hellosign:v3 Sep 11, 2018
@emilong
Copy link
Contributor Author

emilong commented Sep 12, 2018

Thanks for accepting it! 馃槃

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

Successfully merging this pull request may close these issues.

None yet

2 participants