Android : how to set mime type as image/jpeg in multipart file upload in android

on Tuesday, March 24, 2015


Am building an app which requires file uploading to the server .I used multer (node modules) at the server end , The file is uploaded successfully and file is in the uploads folder ,The problem is i need to parse the file based on the mimetype , But when i Upload the mimetype for each file is application/octet-stream



File sourceFile = new File(filePath);
entity.addPart("file", new FileBody(sourceFile));
totalSize = entity.getContentLength();
httppost.setEntity(entity);


I wanna manually set the mimetype of the file while uploading it into the server.


0 comments:

Post a Comment