Title: Invoke-WebRequest should save the file name with the name in Content-Disposition · Issue #11671 · PowerShell/PowerShell · GitHub
Open Graph Title: Invoke-WebRequest should save the file name with the name in Content-Disposition · Issue #11671 · PowerShell/PowerShell
X Title: Invoke-WebRequest should save the file name with the name in Content-Disposition · Issue #11671 · PowerShell/PowerShell
Description: How to get a file name from the server when downloading a file? The server has a Content-Disposition property, how to get it, and is used when downloading files Steps to reproduce $URL=@' https://skydrive.live.com/download?resid=A78ACCAE...
Open Graph Description: How to get a file name from the server when downloading a file? The server has a Content-Disposition property, how to get it, and is used when downloading files Steps to reproduce $URL=@' https://s...
X Description: How to get a file name from the server when downloading a file? The server has a Content-Disposition property, how to get it, and is used when downloading files Steps to reproduce $URL=@' https...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11671
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-WebRequest should save the file name with the name in Content-Disposition","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\nWindows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nThis repository is **ONLY** for PowerShell Core 6 and PowerShell 7+ issues.\r\n\r\n- Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6).\r\n\r\n--\u003e\r\nHow to get a file name from the server when downloading a file?\r\n\r\nThe server has a `Content-Disposition` property, how to get it, and is used when downloading files\r\n# Steps to reproduce\r\n\r\n```powershell\r\n$URL=@'\r\nhttps://skydrive.live.com/download?resid=A78ACCAEBB24EDD7!37948\u0026authkey=!AKjXpDoxgONjhUw\r\n'@\r\n\r\nIwr $URL -outfile ./\r\nOr\r\n$a=Iwr $URL -outfile ./sss\r\n```\r\n\r\n# Expected behavior\r\n\r\n```none\r\nAutoaddfilename\r\nOr\r\nPS \u003e$a.headers\r\n Key Value\r\n--- -----\r\nx-amz-id-2 {XAI956ZLVN5q12SAfXINuiiU6rUrLD0w88mtCcMt1uLcwwv…\r\nx-amz-request-id {3EE4C53FE4416D0E}\r\nDate {Fri, 24 Jan 2020 08:36:04 GMT}\r\nETag {\"c4ac8566c3831011ab981c9662b33183\"}\r\nAccept-Ranges {bytes}\r\nServer {AmazonS3}\r\nLast-Modified {Wed, 18 Dec 2019 08:27:16 GMT}\r\nContent-Disposition {attachment; filename=OpenSSH-Win32.zip}\r\nContent-Type {application/octet-stream}\r\nContent-Length {3018600}\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\nError or null\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable --\u003e\r\n\r\n```none\r\n\r\n```\r\n","author":{"url":"https://github.com/he852100","@type":"Person","name":"he852100"},"datePublished":"2020-01-24T09:12:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/11671/PowerShell/issues/11671"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf0aa475-2c11-2d19-e848-bf12935c882d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A010:23AA91:117BA4A:1786546:6A5450A0 |
| html-safe-nonce | a5f11e81e2d9d947ed9d049dced339126fb54848b1e6db0eea0aabddf0769dc8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDEwOjIzQUE5MToxMTdCQTRBOjE3ODY1NDY6NkE1NDUwQTAiLCJ2aXNpdG9yX2lkIjoiNTUyMDQxODQ2Mzc0OTQ0OTI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b16becfcc5535f51273f55947a55a768863f51c942716d255310432f73c191f4 |
| hovercard-subject-tag | issue:554620226 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/11671/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1b557714cf390ddc6849d006fac3a50bfe0bd9b8bb8602aded839f8b68292768/PowerShell/PowerShell/issues/11671 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1b557714cf390ddc6849d006fac3a50bfe0bd9b8bb8602aded839f8b68292768/PowerShell/PowerShell/issues/11671 |
| og:image:alt | How to get a file name from the server when downloading a file? The server has a Content-Disposition property, how to get it, and is used when downloading files Steps to reproduce $URL=@' https://s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | he852100 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width