on 10-05-2011 5:33 PM
Hi,
I've configured an attribute with File Presentation, so I am able to browse and upload a File to IdM through the UI.
Now I want to store the File in a Folder. Therefore I've created a script which receives the File from IdM DB and convert the File using the uFromHex (since the File is stored as a Hex value in the DB).
This approach works fine for txt files, but not for pdf files.
Does anyone know how to deal with this?
Thanks
Christos
Hi Christos
Try something like the below as an example; Web UI task to upload; attribute Data Type: Binary
Call the script; $FUNCTION.fileupload(%MSKEYVALUE%|%BINARY_FILE_UPLOAD%)$$
function fileupload(Par){
delimiter = "%$glb.SAP_DELIMITER%";
parvalues = Par.split(delimiter);
mskeyvalue = parvalues[0];
file = parvalues[1];
filevalues = file.split(":");
filename = filevalues[0];
filebody = filevalues[1];
filebody = UserFunc.uFromHex(filebody,"ISO-8859-1");
filelocation = "/usr/sap/files/" + filename;
//UserFunc.uErrMsg(1,"User: " + mskeyvalue + " File: " + filename );
UserFunc.uToBinFile(filelocation,filebody,"ISO-8859-1");
}
Hope it helps ...
Rgrds
Craig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Even though the file is downloaded properly , the job throws an error. Any idea?
"java.lang.NullPointerException: while trying to invoke the method java.sql.ResultSet.getMetaData() of a null object loaded from local variable 'rs'" .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
that's the solution! Thanks for your answer!
My fault was that i did not decrypt the value with a specific format. Therefore the file was scrambled every time.
Cheers
Christos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
thanks for your quick response.
Unfortunately it did not work. It works fine if you read a file from disc and store it anywhere else.
I think the issue is that although the attribute has the Datatype Binary, IdM stores the value in HEX format.
Any other idea?
Regads,
Christos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christos
Have you tried setting the attribute to a binary type and use the uToBinFile function?
http://help.sap.com/saphelp_nwidmic71/en/using_functions/internal_functions/dse_utobinfile.htm
Rgrds
Craig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.