Hello everyone,

i don't manage to record an image file in my Openbase database with a webobject application. This webapp use a WOFileUpload and a Submit Button which is bind to this action method :

public WOComponent addToDB()
    {   
                
                EOEditingContext ec = session().defaultEditingContext();
                
                NSData fileContents = new NSData(aFileContents);
                
                artisteItem.setPhotoID(fileContents);
                
                ec.saveChanges();
                
                return null;

        }

PhotoID is an attribute of my EOModel set to "binary" for External type and "NSData" for Value Class.

i have this in my .wod file :

FileUpload2: WOFileUpload {
        data = aFileContents;
        filePath = aFileName;
        mimeType = aMimeType;

And here are my instance variable declared in my Main.java file :

protected NSData aFileContents;
    protected String aFileName;
    protected String aMimeType;
    protected Artiste artiste;
    public Artiste artisteItem;


Anyone can help please ?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to