{"action":"opened","issue":{"url":"https://api.github.com/repos/square/retrofit/issues/2551","repository_url":"https://api.github.com/repos/square/retrofit","labels_url":"https://api.github.com/repos/square/retrofit/issues/2551/labels{/name}","comments_url":"https://api.github.com/repos/square/retrofit/issues/2551/comments","events_url":"https://api.github.com/repos/square/retrofit/issues/2551/events","html_url":"https://github.com/square/retrofit/issues/2551","id":272527094,"number":2551,"title":"issue regarding image upload","user":{"login":"ankitdubey021","id":22837775,"avatar_url":"https://avatars0.githubusercontent.com/u/22837775?v=4","gravatar_id":"","url":"https://api.github.com/users/ankitdubey021","html_url":"https://github.com/ankitdubey021","followers_url":"https://api.github.com/users/ankitdubey021/followers","following_url":"https://api.github.com/users/ankitdubey021/following{/other_user}","gists_url":"https://api.github.com/users/ankitdubey021/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitdubey021/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitdubey021/subscriptions","organizations_url":"https://api.github.com/users/ankitdubey021/orgs","repos_url":"https://api.github.com/users/ankitdubey021/repos","events_url":"https://api.github.com/users/ankitdubey021/events{/privacy}","received_events_url":"https://api.github.com/users/ankitdubey021/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-09T11:15:28Z","updated_at":"2017-11-09T11:15:28Z","closed_at":null,"author_association":"NONE","body":"I'm using retrofit to upload images on server, image are uploading successfully, but without extension.\r\nMeans only image name is uploading to database, extension is not there.\r\nSo image became useless for me.\r\nplease provide help.\r\n\r\nhere is my method in interface->\r\n**@FormUrlEncoded\r\n    @POST(\"/webservices/AssessorAssetsUpload.php\")\r\n    Call &lt; ImageModel &gt; uploadImage(\r\n        @Field(\"name\")String pictype,\r\n        @Field(\"type\")String uploadtype,\r\n        @Field(\"accesser_id\")String asses_id,\r\n        @Field(\"paper_schedule_id\")String paper_id,\r\n        @Field(\"imagefile\")String image\r\n    );**\r\n\r\nmy activity code->\r\n\r\n** String image=imagetoString();\r\n    \r\n        RetrofitInterface retrofit=ApiClient.getApiClient().create(RetrofitInterface.class);\r\n        Call<ImageModel> call=retrofit.uploadImage(imageName,\"image\",assessor_id,paperId,image);\r\n\r\n        call.enqueue(new Callback<ImageModel>() {\r\n            @Override\r\n            public void onResponse(Call<ImageModel> call, Response<ImageModel> response) {\r\n                System.out.println(response.body().getStatus()+\" \"+response.body().getMsg()+\" \"+response.body().getUrl());\r\n\r\n            }\r\n            @Override\r\n            public void onFailure(Call<ImageModel> call, Throwable t) {\r\n                t.printStackTrace();\r\n            }\r\n        });\r\n    }**\r\n\r\n\r\nhere, how i'm converting->\r\n\r\n**private String imagetoString(){\r\n        ByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n        bitmap.compress(Bitmap.CompressFormat.JPEG, 90, stream);\r\n        byte[] bytes=stream.toByteArray();\r\n\r\n        return Base64.encodeToString(bytes,Base64.DEFAULT);\r\n    }**"}}
{"actor":{"display_login":"ankitdubey021"}}