RE: Adding File Upload option to Microsoft Form via Flow HTTP Request and javascript
I found some code that got me really close. It lets me post to the HTTP Request from the Marketing Form like I want but I can't seem to get it to send the actual file that was uploaded when I was in the form. I've been searching for an example of how to do that piece but I can't seem to find anything that really matches what I need. Here's what I've got so far that does at least go out to the endpoint. What I'm missing is code that will tell it how to pull the file I upload and then send that data out to Flow:
<input type="file" accept="image/*" onchange="openFile(event)"><br>
<img id="output">
<script>
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var dataURL = reader.result;
var output = document.getElementById('output');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
};
const xhr = new XMLHttpRequest()
xhr.open('POST', '<myflowHTTPRequestURL>')
xhr.send('output')
</script>