최근 검색


최근 검색 없음

Robert Pearman's Avatar

Robert Pearman

가입한 날짜: 2021년 5월 28일

·

마지막 활동: 2021년 10월 16일

팔로잉

0

팔로워

0

총 활동 수

4

투표 수

0

가입 플랜

1

활동 개요

님의 최근 활동 Robert Pearman

Robert Pearman님이 에 댓글을 입력함

커뮤니티 댓글 Developer - Zendesk APIs

Made some progress by omitting, $fileBinary = [System.Convert]::ToBase64String($fileContentBytes) and just sending the bytes.

댓글 보기 · 2021년 1월 14일에 게시됨 · Robert Pearman

0

팔로워

0

투표 수

0

댓글


Robert Pearman님이 에 댓글을 입력함

커뮤니티 댓글 Developer - Zendesk APIs

Just to say i have confirmed it is the base64 string that becomes the content of the text file.

댓글 보기 · 2021년 1월 14일에 게시됨 · Robert Pearman

0

팔로워

0

투표 수

0

댓글


Robert Pearman님이 에 게시물을 만듦

게시물 Developer - Zendesk APIs

I have read a lot of the posts about this subject but not quite gotten the answer i need.

I am using PowerShell to upload files to ZenDesk, i have it working for the most part. The file is uploaded and i can link it to a ticket.

The problem i have is the content of the file remains as the base64 string, i guess i have something wrong somewhere?

$fileName = "C:\myfolder\outputlog.log"
$shortFileName = "outputlog.log"
$fileUploadURL = ($uploadURL, "filename=$shortFileName" -join "?")
$fileContent = Get-Content $filename
$fileContentBytes = [System.Text.Encoding]::Unicode.GetBytes($fileContent)
$fileBinary = [System.Convert]::ToBase64String($fileContentBytes)
Invoke-WebRequest -Uri $fileUploadURL -Headers $headers -Method post -ContentType "application/binary" -Body $fileBinary

StatusCode        : 201
StatusDescription : Created

Also tried this, $fileBinary = [Convert]::ToBase64String((Get-Content -Path $fileName -Encoding Byte)) with the same result.

 

 

2021년 1월 14일에 게시됨 · Robert Pearman

0

팔로워

1

투표

2

댓글