I have a table with blob content in it, in which I store different file types(text, audio, image, etc)
. After retrieving the byte []
successfully, I don't have any idea of how to convert the [] in such a way as to convert it into a download dialog box.
Here is my code
trns = session.beginTransaction();
Query query = session.createQuery("from FileDownload as fu where fu.Id =:Id");
query.setInteger("Id", id);
FileDownload fileDownload = (FileDownload) query.iterate().next();
byte[] byteArray = fileDownload.getFile();
The above code works fine and I receive a byte []
. But I don't know how to proceed further in order to convert it into a file with the dialog appearing.
Can anyone please help me?