file upload in PowerShell and PDF.co Web API

PDF.co Web API is the Web API with a set of tools for documents manipulation, data conversion, data extraction, splitting and merging of documents. Includes image recognition, built-in OCR, barcode generation and barcode decoders to decode bar codes from scans, pictures and pdf.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

PutUploadFile.ps1

      
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("x-api-key", "{{x-api-key}}") $multipartContent = [System.Net.Http.MultipartFormDataContent]::new() $multipartFile = '/Users/em/Downloads/logo.png' $FileStream = [System.IO.FileStream]::new($multipartFile, [System.IO.FileMode]::Open) $fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data") $fileHeader.Name = "file" $fileHeader.FileName = "/Users/em/Downloads/logo.png" $fileContent = [System.Net.Http.StreamContent]::new($FileStream) $fileContent.Headers.ContentDisposition = $fileHeader $multipartContent.Add($fileContent) $body = $multipartContent $response = Invoke-RestMethod '<insert presignedUrl generated by https://api.pdf.co/v1/file/upload/get-presigned-url >' -Method 'PUT' -Headers $headers -Body $body $response | ConvertTo-Json

VIDEO

ON-PREMISE OFFLINE SDK

Get 60 Day Free Trial

See also:

ON-DEMAND REST WEB API

Get Your API Key

See also: