We are trying to use Laserfiche forms to upload a file to an API before the file goes into Laserfiche. Basically the process is this.
- Laserfiche forms brings in Axios(Javascript library for doing easy AJAX calls to and from APIs)
- Axios does a POST to the API and brings back a response, which gets stored as form fields, to be used for metadata
- Axios grabs a PUT location also during the POST request
- Axios does a PUT of the file to the API using multipart/form-data
- The form is then submitted to Laserfiche after Axios grabs a response 200 from the Server.
- Workflow then handles updating the status of each packet by querying the API every 2 hours or so.
Here is the problem I'm running into. With regular HTML file uploads. I can use Javascript to grab the files that Axios uses during the upload(PUT) process. I can't grab the Files from Laserfiche File upload. Here is a few images of the difference.
Upload Packet is the Laserfiche Upload. Upload File is one I made using custom HTML. Here is a chrome snippet of the first Upload
Image of both, populated with files
Chrome console snippet from both.
(First one, LF Upload)
(Second one, custom HTML File Upload)
So the Laserfiche file upload doesn't retain the data for me to grab with Javascript, but the Custom HTML5 one does.
So the question is, is there any good way, to grab the file from the Laserfiche File Upload component to attach to AXIOS and the AJAX Call?
If not, is there a way to fill the Laserfiche File Upload using Javascript, with the file attached to the HTML5 upload?