Hi! i'm developing an page who is capable to create a new card using some input/select, and i'm trying to create an input type="file" multiple.
Everything is working except upload, i'm using an ajax call using javascript to send the file to one PHP called ajaxResponse.php who is responsible to create a new card and upload the attachments, my doubt is:
- The multiple files is working fine and creating the attachments in the card ie already created, however, the files in trello when the ajax call is done, instead of showing me the right file with the correct extension, the attachment always have 19 bytes, and create an filename which name is Upload, if i download this file and check the content with one text editor, the content of this file is the filename i uploaded in HTML, can anybody tell me how was the correctly way to host a file using API + PHP+ cURL, please?
my Codes:
JAVASCRIPT
var files = document.getElementById('anexoTrello').files;
var formData = new FormData();
for(i = 0; i < myFiles.length; i++){
formData.append('file[]', myFiles[i]);
}
var ajax = new XMLHttpRequest();
ajax.open('POST', 'assets/php/ajaxResponse.php');
ajax.send(formData);
PHP
Thanks!
Hi Ricardo,
Thanks for reaching out!
This would be a really great question to share in our developer community. We have a number of Trello Engineers that are active there, and they'd be happy to give some guidance for more advanced topics like these.
https://community.developer.atlassian.com/c/trello
Also, if it helps, there have been some changes made to how users can access attachments via the API, discussed further here: https://trello.com/c/tnX5dhiI/87-updated-authenticated-access-to-s3
Please let us know if you have any other questions, and we'll be happy to help.
All the best,
Lara
The Trello Team
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.