Hi guys,
This is a follow up question from How to download a BLOB file with its original file format?, when I upload a file and save as BLOB, I lost the file's extension (e.g. test.csv becomes test) if I download it back. So based on some suggestion from that thread, I am trying to setup the MIME_TYPE attribute. To do so, I am trying to parse and get the file's extension via javascript. This is the step by step of what I am doing:
- Using javascript, parse the file's name from the upload field to get the extension and store into a variable (e.g. var EXTENSION = '.csv')
- Using javascript, set a hidden field's value to be the file's extension. This is the command: $s('P1_HIDDEN', EXTENSION)
- Submit the upload file form
Am I doing this correctly? I feel this is too much work to preserve the file's format. And after all these steps I got the ITEM_VALUE_PROTECTION error it seems I am not allowed to set a field's value via javascript? Is there a workaround for this?
I am using Apex v5.0.3
Thank you!
Danny