Currently, I am facing an issue with a client-side component that generates a DataURL when a user uploads or takes a picture and then crops it. My goal is to send this DataURL via an AJAX call to a sails endpoint. As per the documentation provided by Sails, the endpoint will read the files using the following code:
req.file('file_name');
I am unsure about how to convert the DataURI into a format suitable for an AJAX call so that the endpoint can properly read the file from req.file. It would be helpful to see an example of setting up the call in any JavaScript or framework library to guide me through the implementation process.
Your assistance on this matter would be greatly appreciated.