01-04-2013 04:19 AM - edited 01-04-2013 04:19 AM
This is a quick and dirty example. You need to add exception handling and you probably want to use a fixed buffer size so you don't gobble up all the heap.
FileConnection fc = (FileConnection) Connector.open(FQFN);
throw new FileNotFoundException();
DataInputStream in = fc.openDataInputStream();
int len = in.available();
byte data = new byte[len];
The file is now in the byte array "data"
01-04-2013 05:30 AM
Having got the data into byte format, the usual approach is to include this in an HTTP Post to that Server. But how you do this depends on what the Server is expecting. So you need to find out from your Server people what they need you to do.