A client requires that the (client-side only) web app which I am developing uploads a JSON file generated by the app. I have no access to the code of the server-side script which handles the saving of the file to the correct directory. I only have access to the following HTML form which posts to the server-side script:
<form enctype="multipart/form-data" acceptcharset="UTF-8" method="post" style="clear:left" action="/ajax/FileUploader.html?idToUse=attachment-1438128389605&decompress=false&outputLocation=%2Fusr%2Flocal%2Ftomcat%2Fwebapps%2FROOT%2Fimages%2F">
<input size="50" type="file" name="attachment-1438128389605">
<div style="padding-top:5px">
<div style="display:none; margin-left:60px; margin-top:10px; float:left" class="file-type-not-permitted">This file type is not permitted </div>
<input type="submit" name="upload" value="Upload" class="ui-widget ui-state-default ui-corner-all ui-button-disabled ui-state-disabled input-type-submit-small" role="button" aria-disabled="true" disabled="">
</div>
</form>
My client-side app already has access to the server and this particular HTML form via HTTP authentication.
Is it possible to generate the JSON file and attach it as file to the form? The requirement is that this is all done through client-side JavaScript.