Hello,

I am having a mysterious problem with a file upload of photographic
images (JPEG, size about 20k, nothing untoward except for MS Windows
uppercased filenames e.g. P00010002.JPG) in a pretty much out of the box
RIFE/CRUD app.  I am using Tomcat 5.5.17 locally (bundled with
Netbeans), JDK 1.5 and all the latest downloads of RIFE, RIFE/CRUD and
templates.  

When I fill in the add or modify forms to edit data, including an image
upload, it works fine from my local machine (the PostgreSQL database is
on a remote server). All the data appears ok in the CMF tables, and the
images display as expected. Relevant bits of the bean for my data are:

public class HistoricSitesPhotoData extends MetaData {

...
private byte[]      mImage = null;
...

public void activateMetaData()
    {
...
addConstraint(new ConstrainedProperty("image")
            .notNull(true)
            .file(true)
            .listed(true)            
            .mimeType(MimeType.JPEG));
...
}

...
public void         setImage(byte[] image)                  { mImage =
image; }
public byte[]       getImage()                              { return
mImage; }
...

}

However, if I deploy my webapp on my live server, Tomcat 5.5.4, JDK
1.5, same database as above,  everything appears to work BUT no image
data appears in the database tables (all the other data e.g. caption,
copyright owner etc are transferred ok).  There is an entry in the CMF
contentstoreimage table, but there is no blob data there, just a zero
length field.  When I do this operation from my local machine it works
and the binary data is there.  RIFE/CRUD has created the image column as
a bytea type in PostgreSQL.

If I change my data type above to MimeType.RAW, everything works
locally and live.  However, the images are not treated by RIFE/CRUD as
such and are displayed as links.  I notice that the binary data goes
into contentstorerawchunk instead.  I could probably work with this, but
would prefer to understand the above problem.

It suggests that there isn't a problem with server settings or
permissions. I note that the eCalendar example uses java.io.InputStream
for the attachment upload.  I tried this and get a "field invalid" error
all the time.

Anyone seen the above problems before? Help as to where to look would
be very much appreciated.

Thanks,

David Herbert
British Antarctic Survey.


--  
This message (and any attachments) is for the recipient only.  NERC is subject
to the Freedom of Information Act 2000 and the contents of this email and any
reply you make may be disclosed by NERC unless it is exempt from release under
the Act.  Any material supplied to NERC may be stored in an electronic
records management system.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to