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

Add a zip attachment example #922

Merged
merged 3 commits into from
Nov 17, 2023
Merged

Conversation

meztez
Copy link
Collaborator

@meztez meztez commented Nov 16, 2023

How to return multiple object in an archive. Adding an example. Not sure, if it should be added as a feature or the right API for it either.

as_attachment <- function(value, filename, ..., .list = NULL) {
  ...
}

What if the user wants to use different serializers for each file?

At least this is an example for the current version of plumber.

@schloerke
Copy link
Collaborator

What if the user wants to use different serializers for each file?

They'll need to handle it themselves in the route

@schloerke
Copy link
Collaborator

At least this is an example for the current version of plumber.

Yes. Even if we made a zip serializer, they would need to construct a folder with the content ready to go. It still leaves a clunky user interaction, so an example of how it's possible would be better.

Copy link
Collaborator

@schloerke schloerke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

inst/plumber/16-attachment/plumber.R Outdated Show resolved Hide resolved
inst/plumber/16-attachment/plumber.R Outdated Show resolved Hide resolved
@schloerke schloerke merged commit 0c59025 into rstudio:main Nov 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants