Hello all,

I took some vacations on St-Marteen Island, and i am back now, hope you had a great last week. I see that the discusison on the WOCommunity Topic has been exciting and rich

I'd like to contribute even i don't know how still.

Meanwhile, i need some clue to implement a WOFileUpload as a D2WCustomComponent I managed to create a partial component and it displays in the D2WApp, but the file i choose is not saved in the database…

Here my files :

===
The CustomComponent : UploadDataPage
===


import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;

public class UploadDataPage extends WOComponent {
        
        protected NSData aFileContents;
        protected String aMimeType;
        protected String aUrl;
        
        protected EOEnterpriseObject object;
        protected String key;
        
    public UploadDataPage(WOContext context) {
        super(context);
    }

        
public void takeValuesFromRequest(WORequest request, WOContext context) {
                object.takeValueForKey(aFileContents, key);
        }
        
        public WOComponent addFile() {
                object.takeValueForKey(aFileContents, key);
                return null;
        }

}

===
The Wod File
===

FileUpload1: WOFileUpload {
        data = aFileContents;
        mimeType = aMimeType;
}

Form1: WOForm {
        enctype = "mutlipart/form-data";
}

SubmitButton1: WOSubmitButton {
        action = addFile;
        value = "Click Here when done";
} _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to