Recherches récentes


Pas de recherche récente

Robert Pearman's Avatar

Robert Pearman

Adhésion le 28 mai 2021

·

Dernière activité le 16 oct. 2021

Suivis

0

Abonnés

0

Activité totale

4

Votes

0

Abonnement

1

APERÇU DES ACTIVITÉS

Dernière activité effectuée par Robert Pearman

Robert Pearman a ajouté un commentaire,

Commentaire de la communauté Developer - Zendesk APIs

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

Afficher le commentaire · Publication le 14 janv. 2021 · Robert Pearman

0

Abonnés

0

Votes

0

Commentaire


Robert Pearman a ajouté un commentaire,

Commentaire de la communauté Developer - Zendesk APIs

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

Afficher le commentaire · Publication le 14 janv. 2021 · Robert Pearman

0

Abonnés

0

Votes

0

Commentaire


Robert Pearman a créé une publication,

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

 

 

Publication le 14 janv. 2021 · Robert Pearman

0

Abonnés

1

vote

2

Commentaires