jQuery. Inside:
xxx.bind('submit',function() {
...
oSignedData.Content - contains decrypted PDF, DOC, JPG or other file
}
How I can pass this file for user?
When I use document.getElementById('invoice_encoded_data').value = oSignedData.Content
resultant file is corrupted.
Please, reply ASAP.
You can’t do that!!! You must let the browser decide what kind of file it is, and then manage the download from the server. So your best bet is to contain url to that file in
oSignedData.Contentand then usedocument.location = oSignedData.Content;to make browser download that data, or display it inside an IFrame…So you can’t download binary data to the JavaScript variable as Base64 string (or some other binary-data-to-string encription) with AJAX, decrypt it to binary data and store it in other JS var, and then try to use it as an image, pdf or whatever.