Pesquisas recentes


Sem pesquisas recentes

Robert Pearman's Avatar

Robert Pearman

Entrou em 28 de mai. de 2021

·

Última atividade em 16 de out. de 2021

Seguindo

0

Seguidores

0

Atividade total

4

Votos

0

Assinatura

1

VISÃO GERAL DA ATIVIDADE

Atividade mais recente por Robert Pearman

Robert Pearman comentou,

Comentário na comunidade Developer - Zendesk APIs

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

Exibir comentário · Publicado 14 de jan. de 2021 · Robert Pearman

0

Seguidores

0

Votos

0

Comentários


Robert Pearman comentou,

Comentário na comunidade Developer - Zendesk APIs

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

Exibir comentário · Publicado 14 de jan. de 2021 · Robert Pearman

0

Seguidores

0

Votos

0

Comentários


Robert Pearman criou uma publicação,

Publicação 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.

 

 

Publicado 14 de jan. de 2021 · Robert Pearman

0

Seguidores

1

Votos

2

Comentários