Hi guys,
When I upload a pdf to a Trello card. the response will always include this:
```
bytes: null,
isUpload: false,
```
as if the upload failed. But the upload actually succeeded....
This only happens when I upload a pdf
I tried to play with the mime type I used: application/pdf, x-pdf, image/png
Does anyone know how to get the API to return a successful response?
Thanks in advance!
Update:
I figured it out. The file needs to be in a form using system.io.fileinfo
. I'm on PowerShell 7 and I believe you might have to get into some .NET to make it work on PS5.1.
$FORM = @{
idList = "xxxxxx"
pos = "top"
name = "TestTest"
fileSource = [system.io.fileinfo]"C:\Path\Path\File.pdf"
}
Invoke-RestMethod -Method Post -Uri "https://api.trello.com/1/cards?$APIKEY" -Form $FORM
I'm having the same issue using Invoke-RestMethod in PowerShell in creating a new card with a PDF attachment. If the attachment is a simple .txt it works fine. I'm guessing it has something to do with encoding. Does anyone have a code example in PowerShell with attaching anything other than a .txt to a new card?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Glenn maybe try posting over at https://community.developer.atlassian.com/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamahl M-D I've never been able to make file uploading work in the Trello API, I just attach links -- internally they're represented as links anyway. You might like to review the discussion here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.