I got this working with help from IRC channel #android-dev by user : memoryleak. It was an encoding related issue.
To fix it do this when uploading on :
Client side (Javascript) :
formdata.append("filedata", file, encodeURIComponent(file['name']));
Server Side (NanoHTTPD) :
URLDecoder.decode(session.getParms().get(entry.getKey()), "UTF-8");