Ricerche recenti


Nessuna ricerca recente

Robert Pearman's Avatar

Robert Pearman

Data ingresso 28 mag 2021

·

Ultima attività 16 ott 2021

Seguiti

0

Follower

0

Attività totali

4

Voti

0

Abbonamento

1

PANORAMICA ATTIVITÀ

Ultima attività di Robert Pearman

Robert Pearman ha commentato,

Commento nella community Developer - Zendesk APIs

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

Visualizza commento · Data ultimo post: 14 gen 2021 · Robert Pearman

0

Follower

0

Voti

0

Commenti


Robert Pearman ha commentato,

Commento nella community Developer - Zendesk APIs

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

Visualizza commento · Data ultimo post: 14 gen 2021 · Robert Pearman

0

Follower

0

Voti

0

Commenti


Robert Pearman ha creato un post,

Post 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.

 

 

Data ultimo post: 14 gen 2021 · Robert Pearman

0

Follower

1

Voto

2

Commenti