Hello
i want to send a file from a smartphone "A" with ion to a smartphone "B" with nanoHttpd
in the smartphone B i try to get the byte of the JPEG image and write it to a file
If i use this function : session.parseBody(files);
I have a timeout error => Read timed out
another solution is to get the byte like this but the image isn't readable
Integer contentLength = Integer.parseInt(session.getHeaders().get( "content-length" ));
byte[] buf = new byte[contentLength];
Log.d(TAG,"RequestBody: " + new String(buf));
this is my code to send the file from the smartphone A :
Ion.with(mContext)
.load(...)
.setMultipartParameter("id_file", id_file)
.setMultipartFile("image", "image/jpeg", file_data)
ok i changed the the timeout in the start server function
server.start(10000000);
but now i have this error ;
BAD REQUEST: Content type is multipart/form-data but contains less than two boundary strings
Hello i want to send a file from a smartphone "A" with ion to a smartphone "B" with nanoHttpd
in the smartphone B i try to get the byte of the JPEG image and write it to a file
If i use this function : session.parseBody(files); I have a timeout error => Read timed out
another solution is to get the byte like this but the image isn't readable
Integer contentLength = Integer.parseInt(session.getHeaders().get( "content-length" )); byte[] buf = new byte[contentLength]; Log.d(TAG,"RequestBody: " + new String(buf));
this is my code to send the file from the smartphone A : Ion.with(mContext) .load(...) .setMultipartParameter("id_file", id_file) .setMultipartFile("image", "image/jpeg", file_data)