System.out.println("url-->> " + URL);
conn = (HttpConnection) Connector.open(URL);
conn.setRequestMethod(HttpConnection.POST);
FileConnection fc = (FileConnection) Connector.open(localFoto);
if (!fc.exists()) {
throw new IOException("File does not exists");
}
if (!fc.canRead()) {
throw new IOException("nao posso ler essa merda");
}
InputStream imgIs = fc.openInputStream(); //PARA AQUI
byte[] imgData = new byte[(int) fc.fileSize() + 1000];
imgIs.read(imgData);
String message1 = "";
message1 += "-----------------------------4664151417711" + CrLf;
message1 += "Content-Disposition: form-data; name=\"uploadedfile\"; filename=\""
+ imgname + "\"" + CrLf;
message1 += "Content-Type: image/jpeg" + CrLf;
message1 += CrLf;
Fala galera,
Eu tenho esse código ai funcionando em outra classe sem erros.
Porém nessa classe ai de cima lança uma java.lang.IllegalArgumentException: no ‘:’ in URL
A URL do erro é “http://mobile.gdx02.com.br/fotos.php”;
Alguma dica??