I want to FTP an image from my Android app to my server. The problem is, I am trying to do this right now:
String data = client.storeFile("picture.png", myBitmap);
but you can't send bitmaps through storeFile, only files. So my question is: how can I put this bitmap into a file to send? Do I have to save the picture on the phone first? (I would prefer not to). Any ideas? Thanks.
FTPClient client = new FTPClient();
Bitmap myBitmap = my bitmap;
try {
client.connect("myhost");
boolean login = client.login("un", "pw");
client.enterLocalPassiveMode();
client.setFileType(FTP.BINARY_FILE_TYPE);
String data = client.storeFile("picture.png", myBitmap);
//here is where I need a file, not bitmap
logout = client.logout();
client.disconnect();