Qual è la sintassi corretta per il caricamento dei file dal Extension Messenger?
Questo è il mio codice attuale
HTML
<input id=file type=file/>
JavaScript
var file = document.getElementById(file).files[0];
var fd = new FormData();
fd.append( message, {attachment:{type:image,payload:{}}} );
fd.append( filedata, file );
MessengerExtensions.beginShareFlow(
function success() {
},
function error(errorCode, errorMessage) {
alert(Failed to share. Please try again. ErrorCode : + errorCode + , error message : + errorMessage )
},
data,
broadcast
);
Quando ho eseguito questo codice, continuo a ricevere l'errore
Invalid attachment in MessageContent provided to SDK API call
Error code : 2071022
Nell'esempio CURL sulla pagina di documentazione , stanno usando -F, ecco perché sto cercando con dati del modulo. Se non come formdata, come dovrei essere l'invio del file?













