I am trying to interact with the "API" at another company. Their API is actually a file upload form which asks for a CSV file. It's a standard HTML form with an element like so:
<input type="file" id="inputFileUploadFile" name="UploadFile">
I have a page where a user can view a set of table data. I am looking for a way to have a one-button solution where the user can look at the table data and submit it as a file to this so-called API.
Generating the data in CSV format is easy enough. The question, specifically, is how do I then get that data into the form element and submit it?
I can either use jQuery to manipulate and submit a hidden HTML form, or I can use PHP to submit the form directly. An answer in either format works.