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 downloading excel and csv responses with content disposition attachment header #2274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LauraXiulan
Copy link

@LauraXiulan LauraXiulan commented Aug 16, 2023

When retrieving an CSV or EXCEL file as response in the Developer Portal, the response is shown inline, which makes it unreadable. This PR adds logic to download these kinds of responses instead.

Suggestions, remarks and edits are welcome. I tested the code locally for our own APIM by temporary switching to Self-Hosted.
I have only added CSV and EXCEL in this PR, but I can imagine a usecase for PDF's as well.

@LauraXiulan
Copy link
Author

@microsoft-github-policy-service agree

@LauraXiulan
Copy link
Author

#1984

@LauraXiulan
Copy link
Author

@ygrik @malincrist @azaslonov

@verschaevesiebe
Copy link

Nice addition, we sometimes have the intent to download other content types. Eg. a very large JSON file for example.
Would you be able to include a similar feature for attachment disposition types where filenames are json or by means any text formal is applicable ?

E.g xml, text, json, jsonc, etc ...

header('Content-Disposition: attachment; filename=data.json');
header('Content-Type: application/json');

Would be amazing thanks !

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.

None yet

3 participants