René's URL Explorer Experiment


Title: Request for help: how to use DotNet HttpClient to async upload large files using multipart/form-data within PowerShell · Issue #13721 · PowerShell/PowerShell · GitHub

Open Graph Title: Request for help: how to use DotNet HttpClient to async upload large files using multipart/form-data within PowerShell · Issue #13721 · PowerShell/PowerShell

X Title: Request for help: how to use DotNet HttpClient to async upload large files using multipart/form-data within PowerShell · Issue #13721 · PowerShell/PowerShell

Description: I was asked in #4129 to open a new issue to discuss my request for help. I originally posted this question on Stackoverflow, and have had no responses. I'm not sure if this is a question for the PowerShell or DotNetCore team, but I'm sta...

Open Graph Description: I was asked in #4129 to open a new issue to discuss my request for help. I originally posted this question on Stackoverflow, and have had no responses. I'm not sure if this is a question for the Po...

X Description: I was asked in #4129 to open a new issue to discuss my request for help. I originally posted this question on Stackoverflow, and have had no responses. I'm not sure if this is a question for th...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13721

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Request for help: how to use DotNet HttpClient to async upload large files using multipart/form-data within PowerShell","articleBody":"I was asked in #4129 to open a new issue to discuss my request for help.  I originally posted this question on [Stackoverflow](https://stackoverflow.com/questions/63711832/c-sharp-netcore-httpclient-postasync-multipart-form-data-with-file-attachment-a), and have had no responses.  I'm not sure if this is a question for the PowerShell or DotNetCore team, but I'm starting here.\r\n\r\nI am in the process of working on updating some PowerShell code that uses `System.Net.HttpWebRequest` to handle file transfers to and from a web service. The `System.IO.FileStream` class has a major problem with handling file streams being transferred to a web service using `HttpWebRequest` and the object (file) is greater than 2GB.  [It was stated](https://github.com/PowerShell/PowerShell/issues/4129#issuecomment-617542425) in #4129 this was a breaking change, and will not be fixed by the .NetCore team, [and ask the question here](https://github.com/PowerShell/PowerShell/issues/4129#issuecomment-672008052). Essentially, one runs into the following exception in PowerShellCore/PowerShell7:\r\n\r\n```powershell\r\nMethodInvocationException: C:\\Users\\clynch\\Documents\\WindowsPowerShell\\modules\\modulename\\modulename.psm1:35180\r\n Line |\r\n35180 |                  $rs.write($readbuffer, 0, $bytesRead)\r\n      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n      | Exception calling \"Write\" with \"3\" argument(s): \"Stream was too long.\"\r\n```\r\nI have the following verified and working PowerShell code I am trying to convert to C# async class method using `HttpClient` to asynchronously upload files to an Apache/Spring-based REST API service when using PowerShell 5.x, or within PowerShell7/PowerShellCore only when the file is less than 2GB in size:\r\n\r\n```powershell\r\n$Hostname   = \"somewebserver\"\r\n$Method     = \"POST\"\r\n$File       = Get-ChildItem C:\\Directory\\file.iso\r\n$FSOpenMode = [System.IO.FileMode]::Open\r\n$FSRead     = [System.IO.FileAccess]::Read\r\n\r\n# Read file using FileStream\r\n$fs = [IO.FileStream]::new($File.FullName, $FSOpenMode, $FSRead)\r\n\r\n[void]$fs.FlushAsync()\r\n\r\ntry\r\n{\r\n\r\n    # Set the URL that will be the upload destination\r\n    $url = \"https://{0}/upload?uploadfilename={1}\" -f $Hostname, $File.Name\r\n\r\n    $_DispositionContentType = \"application/octet-stream\"\r\n\r\n    [System.Net.httpWebRequest]$uploadRequest = [System.Net.WebRequest]::Create($uri)\r\n    $uploadRequest.Method = $Method\r\n\r\n    $boundary = \"---------------------------\" + [DateTime]::Now.Ticks.ToString(\"x\")\r\n    [byte[]]$BoundaryBytes = [System.Text.Encoding]::UTF8.GetBytes(\"`r`n--\" + $boundary + \"`r`n\");\r\n    $disposition = \"Content-Disposition: form-data; name=`\"file`\"; filename=`\"{0}`\";`r`nContent-Type: {1}`r`n`r`n\" -f $File.Name, $_DispositionContentType\r\n    [byte[]]$ContentDispBytes = [System.Text.Encoding]::UTF8.GetBytes($disposition);\r\n    [byte[]]$EndBoundaryBytes = [System.Text.Encoding]::UTF8.GetBytes(\"`r`n--\" + $boundary + \"--`r`n\")\r\n\r\n    $uploadRequest.Timeout = 1200000\r\n    $uploadRequest.ContentType = \"multipart/form-data; boundary={0}\" -f $boundary\r\n    $uploadRequest.Headers.Item(\"auth\") = \"SessionID\"\r\n    $uploadRequest.Headers.Item(\"uploadfilename\") = $File.Name\r\n    $uploadRequest.AllowWriteStreamBuffering = $true\r\n    $uploadRequest.SendChunked = $true\r\n    $uploadRequest.ContentLength = $BoundaryBytes.length + $ContentDispBytes.length + $File.Length + $EndBoundaryBytes.Length\r\n    $uploadRequest.Headers.Item(\"ContentLength\") = $BoundaryBytes.length + $ContentDispBytes.length + $File.Length + $EndBoundaryBytes.Length\r\n\r\n    $rs = $uploadRequest.GetRequestStream()\r\n    [void]$rs.FlushAsync()\r\n\r\n    [byte[]]$readbuffer = [byte[]]::new(4096 * 1024)\r\n    $rs.write($BoundaryBytes, 0, $BoundaryBytes.Length);\r\n    $rs.write($ContentDispBytes, 0, $ContentDispBytes.Length);\r\n\r\n    # This is used to keep track of the file upload progress.\r\n    $numBytesToRead = $fs.Length\r\n    [int64]$numBytesRead = 0\r\n\r\n    $_sw = [System.Diagnostics.Stopwatch]::StartNew()\r\n    $_progresssw = [System.Diagnostics.Stopwatch]::StartNew()\r\n\r\n    while ($bytesRead = $fs.Read($readbuffer, 0, $readbuffer.length))\r\n    {\r\n\r\n        [void]$fs.Flush()\r\n\r\n        $rs.write($readbuffer, 0, $bytesRead)\r\n\r\n        [void]$fs.Flush()\r\n        [void]$rs.Flush()\r\n\r\n        # Keep track of where we are at clearduring the read operation\r\n        $_numBytesRead += $bytesRead\r\n\r\n        # Flush the buffer every 200ms and 1MB written\r\n        if ($_progresssw.Elapsed.TotalMilliseconds -ge 200 -and $_numBytesRead % 100mb -eq 0)\r\n        {\r\n\r\n            [void]$rs.flush()\r\n\r\n        }\r\n\r\n        # Use the Write-Progress cmd-let to show the progress of uploading the file.\r\n        [Int]$_percent = [math]::floor(($_numBytesRead / $fs.Length) * 100)\r\n\r\n        # Elapsed time to calculat throughput\r\n        [Int]$_elapsed = $_sw.ElapsedMilliseconds / 1000\r\n\r\n        if ($_elapsed -ne 0 )\r\n        {\r\n\r\n            [single]$_transferrate = [Math]::Round(($_numBytesRead / $_elapsed) / 1mb)\r\n\r\n        }\r\n\r\n        else\r\n        {\r\n\r\n            [single]$_transferrate = 0.0\r\n\r\n        }\r\n\r\n        $status = \"({0:0}MB of {1:0}MB transferred @ {2}MB/s) Completed {3}%\" -f ($_numBytesRead / 1MB), ($numBytesToRead / 1MB), $_transferrate, $_percent\r\n\r\n        # Handle how poorly Write-Progress adds latency to the file transfer process by only refreshing the progress at a specifc interval\r\n        if ($_progresssw.Elapsed.TotalMilliseconds -ge 500)\r\n        {\r\n\r\n            if ($_numBytesRead % 1mb -eq 0)\r\n            {\r\n\r\n                Write-Progress -activity \"Upload File\" -status (\"Uploading '{0}'\" -f $File.Name) -CurrentOperation $status -PercentComplete $_percent\r\n\r\n            }\r\n\r\n        }\r\n\r\n    }\r\n\r\n\r\n    $fs.close()\r\n\r\n    # Write the endboundary to the file's binary upload stream\r\n    $rs.write($EndBoundaryBytes, 0, $EndBoundaryBytes.Length)\r\n\r\n    $rs.close()\r\n\r\n    $_sw.stop()\r\n    $_sw.Reset()\r\n\r\n    Write-Progress -activity \"Upload File\" -status (\"Uploading '{0}'\" -f $File.Name)  -Complete\r\n\r\n}\r\n\r\ncatch [System.Exception]\r\n{\r\n\r\n    if ($fs)\r\n    {\r\n\r\n        $fs.close()\r\n\r\n    }\r\n\r\n    if ($_sw.IsRunning)\r\n    {\r\n\r\n        $_sw.Stop()\r\n        $_sw.Reset()\r\n\r\n    }\r\n\r\n    # Dispose if still exist\r\n    if ($rs)\r\n    {\r\n\r\n        $rs.close()\r\n\r\n    }\r\n\r\n    Throw $_\r\n\r\n}\r\n\r\ntry\r\n{\r\n\r\n    # Indicate we are waiting for the API to process the uploaded file in the write progress display\r\n    Write-Progress -activity \"Upload File\" -status (\"Uploading '{0}'\" -f $File.Name)  -CurrentOperation \"Waiting for completion response from appliance.\" -percentComplete $_percent\r\n\r\n    # Get the response from the API on the progress of identifying the file\r\n    [Net.httpWebResponse]$WebResponse = $uploadRequest.getResponse()\r\n    $uploadResponseStream = $WebResponse.GetResponseStream()\r\n\r\n    # Read the response & convert to JSON\r\n    $reader = [System.IO.StreamReader]::new($uploadResponseStream)\r\n    $responseJson = $reader.ReadToEnd()\r\n\r\n    $uploadResponse = ConvertFrom-Json $responseJson\r\n\r\n    $uploadResponseStream.Close()\r\n\r\n    $uploadRequest = $Null\r\n\r\n    # Finalize write progress display\r\n    Write-Progress -activity \"Upload File\" -CurrentOperation \"Uploading $Filename \" -Completed\r\n\r\n}\r\n\r\ncatch [Net.WebException]\r\n{\r\n\r\n    if ($null -ne $_.Exception.Response)\r\n    {\r\n\r\n        Try\r\n        {\r\n\r\n            # Need to see if Response is not empty\r\n\r\n            $sr = [IO.StreamReader]::new($_.Exception.Response.GetResponseStream())\r\n\r\n        }\r\n\r\n        Catch\r\n        {\r\n\r\n            $PSCmdlet.ThrowTerminatingError($_)\r\n\r\n        }\r\n\r\n        $errorObject = $sr.readtoEnd() | ConvertFrom-Json\r\n\r\n        # dispose if still exist\r\n        if ($rs)\r\n        {\r\n\r\n            $rs.close()\r\n\r\n        }\r\n\r\n        if ($fs)\r\n        {\r\n\r\n            $fs.close()\r\n\r\n        }\r\n\r\n        $sr.close()\r\n\r\n        # This New-ErrorRecord is an internal function that generates a new System.Management.Automation.ErrorRecord object to then throw\r\n        $ErrorRecord = New-ErrorRecord HPEOneview.Appliance.UploadFileException $errorObject.ErrorCode InvalidResult 'Upload-File' -Message $errorObject.Message -InnerException $_.Exception\r\n\r\n        Throw $ErrorRecord\r\n\r\n    }\r\n\r\n    else\r\n    {\r\n\r\n       Throw $_\r\n\r\n    }\r\n\r\n}\r\n```\r\n\r\nThe following working C# code is the result of some research I have done to try to understand how HttpClient works with multipart/form-data uploads:\r\n\r\n``` csharp\r\npublic class HttpClientUpload : IDisposable\r\n{\r\n\r\n    private readonly string _uploadUrl;\r\n    private readonly string _sourceFilePath;\r\n    private readonly string _authToken;\r\n\r\n    // THIS IS ONLY HERE FOR TESTING\r\n    private static HttpClientHandler _handler = new HttpClientHandler() { ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } };\r\n    private HttpClient _httpClient = new HttpClient(_handler)\r\n    {\r\n        Timeout = TimeSpan.FromDays(1)\r\n    };\r\n\r\n    public delegate void ProgressChangedHandler(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage);\r\n\r\n    public event ProgressChangedHandler ProgressChanged;\r\n\r\n    public HttpClientUpload(string uploadUrl, string sourceFilePath, string authToken)\r\n    {\r\n        _uploadUrl = uploadUrl;\r\n        _sourceFilePath = sourceFilePath;\r\n        _authToken = authToken;\r\n    }\r\n\r\n    // Borrowed code from https://stackoverflow.com/questions/16416601/c-sharp-httpclient-4-5-multipart-form-data-upload\r\n    public void UploadAsync()\r\n    {\r\n\r\n        var Path = _sourceFilePath;\r\n        var Appliance = _uploadUrl;\r\n        var AuthToken = _authToken;\r\n\r\n        var m_CancellationSource = new CancellationTokenSource();\r\n        var token = m_CancellationSource.Token;\r\n        var fileInfo = new System.IO.FileInfo(Path);\r\n        var uri = $\"https://{Appliance}/rest/firmware-bundles?uploadfilename={fileInfo.Name}\";\r\n\r\n        // If the file extension is CRL, we need to use a different disposition/mime type declaration.\r\n        var DispositionContentType = fileInfo.Extension == \"crl\" ? \"application/pkix-crl\" : \"application/octet-stream\";\r\n\r\n        _httpClient.DefaultRequestHeaders.Add(\"User-Agent\", $\"Custom User Agent ({Environment.OSVersion.ToString()})\");\r\n        _httpClient.DefaultRequestHeaders.Add(\"X-API-Version\", \"1800\");\r\n        _httpClient.DefaultRequestHeaders.Add(\"auth\", AuthToken);\r\n        _httpClient.DefaultRequestHeaders.Add(\"uploadfilename\", fileInfo.Name);\r\n        _httpClient.DefaultRequestHeaders.Add(\"accept-language\", \"en_US\");\r\n        _httpClient.DefaultRequestHeaders.Add(\"accept-encoding\", \"gzip, deflate\");\r\n\r\n        using (var content = new MultipartFormDataContent(\"---------------------------\" + DateTime.Now.Ticks.ToString(\"x\")))\r\n        {\r\n\r\n            content.Headers.Add(\"Content-Disposition\", $\"form-data; name=\\\"file\\\"; filename=\\\"{fileInfo.Name}\\\"\");\r\n\r\n            content.Headers.ContentLength = fileInfo.Length;\r\n\r\n            FileStream fs = File.OpenRead(Path);\r\n\r\n            var streamContent = new StreamContent(fs);\r\n            streamContent.Headers.Add(\"Content-Type\", $\"{DispositionContentType}\");\r\n            streamContent.Headers.Add(\"Content-Disposition\", $\"form-data; name=\\\"file\\\"; filename=\\\"{fileInfo.Name}\\\"\");\r\n            content.Add(streamContent, \"file\", fileInfo.FullName);\r\n\r\n            Task\u003cHttpResponseMessage> message = _httpClient.PostAsync(uri, content);\r\n\r\n            var input = message.Result.Content.ReadAsStringAsync();\r\n            Console.WriteLine(input.Result);\r\n            Console.WriteLine(\"Press enter to continue...\");\r\n            Console.Read();\r\n\r\n        }\r\n\r\n    }\r\n\r\n    public void Stop()\r\n    {\r\n\r\n        _httpClient.CancelPendingRequests();\r\n\r\n        throw new OperationCanceledException(\"File upload cancelled.\");\r\n\r\n    }\r\n\r\n    public void Dispose()\r\n    {\r\n\r\n        _httpClient?.Dispose();\r\n\r\n    }\r\n\r\n}\r\n```\r\nThe code above can be invoked from PowerShell as such, using a compiled DotNet class library that is imported into the users PowerShell runspace or using `Add-Type`:\r\n\r\n```powershell\r\n$Hostname  = \"somewebserver\"\r\n$AuthToken = \"SessionID\"\r\n$FileName  = 'C:\\directory\\somefile.iso'\r\n$Task      = ([HttpClientUpload]::new($Hostname, $FileName, $AuthToken)).UploadAsync()\r\n```\r\n\r\nThe file appears to be transferred to the target, but the API endpoint generates an error. Not an HTTP error, but a JSON response indicating that this webservice couldn't parse the file.  I get this in our API application log file:\r\n\r\n> caught apache common fileuploadexception ex=Processing of multipart/form-data request failed. Stream ended unexpectedly while uploading file somefile.iso\r\n\r\nI know that this is caused by the fact that the request from the client must append a byte array of an endboundary. Because without it, I would get the very same message with the original PowerShell code I currently use if I omit the following line(s):\r\n\r\n```powershell\r\n# Write the endboundary to the file's binary upload stream\r\n$rs.write($EndBoundaryBytes, 0, $EndBoundaryBytes.Length)\r\n```\r\n\r\nSo, the TL;DR to my post. My questions are:\r\n\r\n1. How does one ensure that a multipart/form-data request that needs to include a binary stream of a file contains the start and end boundary for the `HttpClient` request?  I have found no Microsoft documentation that outlines the requirements to properly construct an `HttpClient` object with the necessary IO stream to send this multipart/form-data request to a web service.\r\n1. Any guidance on how to then chunk the file stream in order to report buffer transfer progress? I intend to read this from PowerShell after the async task has begun, in order to use Write-Progress back to the user.\r\n\r\nPowerShell environments:\r\n\r\n```powershell\r\n# Windows 10\r\n\r\nName                           Value\r\n----                           -----\r\nPSVersion                      7.0.3\r\nPSEdition                      Core\r\nGitCommitId                    7.0.3\r\nOS                             Microsoft Windows 10.0.19041\r\nPlatform                       Win32NT\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\n\r\n```powershell\r\n# Ubuntu 18.04 WSL2 container\r\nPS /mnt/c/Users/clynch> $PSVersiontable\r\n\r\nName                           Value\r\n----                           -----\r\nPSVersion                      7.0.1\r\nPSEdition                      Core\r\nGitCommitId                    7.0.1\r\nOS                             Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58…\r\nPlatform                       Unix\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```","author":{"url":"https://github.com/ChrisLynchHPE","@type":"Person","name":"ChrisLynchHPE"},"datePublished":"2020-09-30T20:26:58Z","url":"https://github.com/PowerShell/PowerShell/issues/13721"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:32000339-6c29-b65a-57a4-f51c6a091d5b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBEBC:3CA547:1FEF08:2AFC56:6AFD44E7
html-safe-nonce42c4477b5c2a565d9fe61fc04aae06558c1469d89344dd6bad1271740562da61
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUJDOjNDQTU0NzoxRkVGMDg6MkFGQzU2OjZBRkQ0NEU3IiwidmlzaXRvcl9pZCI6IjIyOTM0MTE1NzYwNjI3NTYwNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacee1cbb7acabef951251d1e2ceb1413322a95c6a22e4a63c33809eff421a36107
hovercard-subject-tagissue:712256949
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/13721/issue_layout
twitter:imagehttps://opengraph.githubassets.com/513a8b0388ccde8a84ca538e5aef5e9742e12661475380731a9c86601e8602dc/PowerShell/PowerShell/issues/13721
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/513a8b0388ccde8a84ca538e5aef5e9742e12661475380731a9c86601e8602dc/PowerShell/PowerShell/issues/13721
og:image:altI was asked in #4129 to open a new issue to discuss my request for help. I originally posted this question on Stackoverflow, and have had no responses. I'm not sure if this is a question for the Po...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameChrisLynchHPE
hostnamegithub.com
expected-hostnamegithub.com
Nonebdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release556dd37bb0aceffb25724e151b5d858b3265b40b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/13721#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F13721
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F13721
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/13721
Reloadhttps://github.com/PowerShell/PowerShell/issues/13721
Reloadhttps://github.com/PowerShell/PowerShell/issues/13721
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13721
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13721
Request for help: how to use DotNet HttpClient to async upload large files using multipart/form-data within PowerShellhttps://github.com/PowerShell/PowerShell/issues/13721#top
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com/ChrisLynchHPE
Chris Lynch (ChrisLynchHPE)https://github.com/ChrisLynchHPE
on Sep 30, 2020https://github.com/PowerShell/PowerShell/issues/13721#issue-712256949
#4129https://github.com/PowerShell/PowerShell/issues/4129
Stackoverflowhttps://stackoverflow.com/questions/63711832/c-sharp-netcore-httpclient-postasync-multipart-form-data-with-file-attachment-a
It was statedhttps://github.com/PowerShell/PowerShell/issues/4129#issuecomment-617542425
#4129https://github.com/PowerShell/PowerShell/issues/4129
and ask the question herehttps://github.com/PowerShell/PowerShell/issues/4129#issuecomment-672008052
Chris Lynch (ChrisLynchHPE)https://github.com/ChrisLynchHPE
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
on Sep 30, 2020https://github.com/PowerShell/PowerShell/issues/13721#event-3826320157
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Oct 1, 2020https://github.com/PowerShell/PowerShell/issues/13721#issuecomment-701874642
https://stackoverflow.com/questions/48344819/send-large-file-via-httpclienthttps://stackoverflow.com/questions/48344819/send-large-file-via-httpclient
Ilya (iSazonov)https://github.com/iSazonov
Area-Cmdlets-Utilityhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Area-Cmdlets-Utility%22
on Oct 1, 2020https://github.com/PowerShell/PowerShell/issues/13721#event-3827421279
https://github.com/ChrisLynchHPE
Chris Lynch (ChrisLynchHPE)https://github.com/ChrisLynchHPE
on Oct 5, 2020https://github.com/PowerShell/PowerShell/issues/13721#issuecomment-703842639
Ilya (@iSazonov)https://github.com/iSazonov
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Oct 6, 2020https://github.com/PowerShell/PowerShell/issues/13721#issuecomment-704029847
PowerShell/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cshttps://github.com/PowerShell/PowerShell/blob/fc8ca61b3dd2a561d7fe8fbc38fd779278ad7984/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs#L278
fc8ca61https://github.com/PowerShell/PowerShell/commit/fc8ca61b3dd2a561d7fe8fbc38fd779278ad7984
https://github.com/jdescelliers
jdescelliers (jdescelliers)https://github.com/jdescelliers
on Dec 23, 2020https://github.com/PowerShell/PowerShell/issues/13721#issuecomment-750304288
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Jan 18, 2021https://github.com/PowerShell/PowerShell/issues/13721#issuecomment-762029761
Ilya (iSazonov)https://github.com/iSazonov
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 18, 2021https://github.com/PowerShell/PowerShell/issues/13721#event-4216508994
Ryan Yates (kilasuit)https://github.com/kilasuit
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
WG-Cmdlets-Utilityhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets-Utility%22
on Jul 17, 2026https://github.com/PowerShell/PowerShell/issues/13721#event-28139877197
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/13721
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/13721
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get ahttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Question%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.