hello,
i keep getting an insufficient data content error while trying to add a photo to a contact on a s60 mobile phone
while it work great on the s40 would appreciate any help
thank you,

here is the code:
String addImagetoContact (Contact c) throws IOException
{
byte[] data = null;
InputStream is = null;
try
{
if(data==null)
{
is = getClass().getResourceAsStream("./c.jpg");
int length = is.available();
data=new byte[length];
is.read(data);
}
}
catch (Exception e)
{
return "byte prob" + e;
}
try
{

if (c.countValues(Contact.PHOTO) > 0)
{
c.setBinary(Contact.PHOTO, 0, PIMItem.BINARY, data, 0, data.length);
if(c.isModified())
{
try
{
c.commit();
}
catch(Exception e)
{
return "COMMIT "+e;
}
}
else
{
is.close();
return "not modified";
}
is.close();
return "OK";
}
else
{
c.addBinary(Contact.PHOTO, PIMItem.BINARY,data, 0, data.length);
if(c.isModified())
try
{
c.commit();
}
catch(Exception e)
{
return "COMMIT "+e;
}
else
{
is.close();
return "not modified";
}
is.close();
return "OK";
}
}