I'm looking for guidance on how to send a Form via an AJAX request. Specifically, I need help with the 'xmlhttp.open' line. The goal is to upload a video file to a third party video hosting site using their API and provided URL ('upload_link_secure'). Can anyone provide assistance?
Here's my HTML:
<form id="upload" action="'+upload_link_secure+'" method="PUT" enctype="multipart/form-data">
<input type="file" id="vidInput">
<button type="submit" id="submitFile" onclick="uploadMyVid(\''+upload_link_secure+'\')">Upload Video</button>
</form>
This is my javascript:
var uploadMyVid = function(upload_link_secure){
var form = document.getElementById('upload')
// FETCH FILEIST OBJECTS
var vidFile = document.getElementById('vidInput').files;
var xmlhttp = new XMLHttpRequest;
xmlhttp.open('PUT', ); // Need help completing this line???
xmlhttp.send(vidFile);
}