Я хочу загрузить файл jpg в DRACOON с помощью метода, описанного здесь: https://databox.christoph-dengler.de/branding/api/swagger-ui.html# / branding / uploadFileUsingPOST
Я всегда получаю ошибки обратно, как 400 или 500.
Мой код здесь:
#1. Select File
$FileContent = [IO.File]::ReadAllBytes('C:\temp\Bild.jpg');
$fileName = "Bild.jpg"
#2. Upload File
$boundary = [System.Guid]::NewGuid().ToString()
$LF = "`r`n"
$bodyLines = (
"--$boundary",
"Content-Disposition: form-data; name=`"file`"; filename=`"$fileName`"",
"Content-Type: image/jpeg$LF",
$FileContent,
"--$boundary--$LF"
) -join $LF
$AccountUrl = $BaseUrl + "/branding/api/v1/branding/files?type=webSplashImage"
$Response = $null
$Response = Invoke-WebRequest -URI $AccountUrl -Method Post -ContentType "multipart/form-data; boundary=`"$boundary`"" -Headers @{Authorization=("Bearer {0}" -f $Token)} -Body $bodyLines
$Response
#3. Save Branding
Я не знаю, в чем проблема. Есть идеи?