The .cap file uploading mechanism depends if you have a java card or a GlobalPlatform card.Java Card cards are GlobalPlatform based.
If you have a java card you can use the same mechanism that it is used with Cref (see Java Card Kit - Development Kit - Chapter 11): .cap file is divided in n apdus, one or more (if a component not fit in one apdu, for example method component) for component (first:Header.cap, second:directory.cap, third:import.cap, etc).The JCRE spec does not define the applet loader and CREF has a basic version of an applet loader that is not GP compliant, but this is not the Java Card standard. To load onto any physical Java Card you will need to follow the GlobalPlatform specification.
If you use a GlobalPlatform card, the mechanism is more complex:
first you have to create a session using a specific protocol (SCP01, SCP02, etc) through INITIALIZE UPDATE and EXTERNAL AUTHENTICATE commands, then an INSTALL FOR LOAD command and n LOAD commads as they are necessary.
To use GlobalPlatform mechanism, see GlobalPlatform Specification 2.1.1.