cancel
Showing results for 
Search instead for 
Did you mean: 

upload binary file with DSEEntry

daniel_rothmund
Participant
0 Kudos

Hi ,

I have created a Class for a upload pictures to the IDM Database .

Now I have the problem with the upload.... and the mssql datatype.

At the moment the type is binary(max)

is there any option to add a byte[] to DSEntry.put ?
It seems that DSEntry always try a cast to string , and when put a byte[] I receive an exception.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

daniel_rothmund
Participant
0 Kudos

Have someone any solution ?

former_member2987
Active Contributor
0 Kudos

Daniel,

What version of IDM are you using and what type of attribute are you using to store the picture?

Matt

daniel_rothmund
Participant
0 Kudos

Matt ,

we use 7.2 SPS8 an the type is binary.

Daniel

Former Member
0 Kudos

Usually binary values are B64 or HEX encoded during processing in IdM. I take it you're trying to write it to a column of datatype binary, not an actual IdM attribute. Perhaps you should use varbinary(max) if you want to exceed 8000 bytes. But, the internal datatypes and the JDBC datatypes are not the same, so for SQL Server you need to use LONGVARBINARY.

see this MicroSoft reference: Using Advanced Data Types


Anyway, here's a working example. The $includebin function is documented in the helpfile but its usage is pretty self explaining in my example here:


My table looks like this:

daniel_rothmund
Participant
0 Kudos

Hi Per ,

thx for the info ...

And how can add a Binary variable from Java to the DSEntry ?

At the moment I have a byteArray

public DSEEntry next() {

....

byte[] xmlBytes = jcoField.getByteArray();

entry.put(jcoField.getName(),xmlBytes);

....

But with this I receive an Exeption I think the DSEntry does a cast in String ?

Regards

Former Member
0 Kudos

Are you working in the extension framework (WebUI) or in the runtime Custom Connector?

daniel_rothmund
Participant
0 Kudos

Hi Per,

runtime Custom Connector

Regards