I'm not sure whether this is even possible, but I'm trying to attach a file to an outgoing email with the Mandrill API from the file upload button (input type="file"
). To be honest, I'm not entirely sure what document.getElementById('idOfFileInput').value
actually returns. I know that this is not the place to ask a novice question like that, but I've looked everywhere and I can't find it (I know one of you will be sly and point me to some article within five minutes). That aside, though, I've gotten a .txt file to attach with the message C:\fakepath\test.txt
, which I know to be the file path that the browser gives for security. Maybe it's better asked in code:
Button:
Attachment(s): <input type="file" id="file">
JS:
"attachments": [
{
"type": "text/*",
"name": "file_attachment",
"content": document.getElementById('file').value
}
],
I'm sorry if this is a simple question disguised by its context, but even if it is, I have a feeling that this question could be a good future reference because I've been trying things for a week and looking for some type of solution, but I haven't been able to find one. Any ideas?