BLOB to store IFS files
Posted: Fri May 23, 2014 8:07 am
Hello there,
maybe as many of you I'm building an application to upload and download PC files to the iSeries, but I would like to store data into a database table instead of the IFS.
I created a phisical file named ATTACH0F with a simple record format:
ATID - DECIMAL (15,0) Primary key
ATTITLE - Attachment Title
ATFILE - File name. Example /tmp/items.xls
ATBLOB - binary large object to store file
My RPG program shows a grid listing ATTACH0F contents, then you can choose to upload new files or download the ones listed:
Upload to server - If the user needs to add files I placed a button to shown the FileUpload widget to copy files into IFS, then my RPG takes those files and copy them into ATTACH0F and delete them from IFS once the copy is compled.
Download from server - On each grid (subfile) row I placed a button to download the file, but here comes the problem: I need to copy back the file from ATTACH0F into the IFS before using pui.download API.
How can I work it out when the user press the download button?
I hope the problem is clear enough. Thank you for comments
Giovanni
maybe as many of you I'm building an application to upload and download PC files to the iSeries, but I would like to store data into a database table instead of the IFS.
I created a phisical file named ATTACH0F with a simple record format:
ATID - DECIMAL (15,0) Primary key
ATTITLE - Attachment Title
ATFILE - File name. Example /tmp/items.xls
ATBLOB - binary large object to store file
My RPG program shows a grid listing ATTACH0F contents, then you can choose to upload new files or download the ones listed:
Upload to server - If the user needs to add files I placed a button to shown the FileUpload widget to copy files into IFS, then my RPG takes those files and copy them into ATTACH0F and delete them from IFS once the copy is compled.
Download from server - On each grid (subfile) row I placed a button to download the file, but here comes the problem: I need to copy back the file from ATTACH0F into the IFS before using pui.download API.
How can I work it out when the user press the download button?
I hope the problem is clear enough. Thank you for comments
Giovanni