We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to upload Image File Using retrofit but Couldnt do it so i found Some work around
For retro fit Call @multipart @post("END_POINT OF API") CalluploadFile(@part("xyz(Filename)";filename="image.*(type of file)" ") RequestBody xyz);
when You Call it using in your App RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"),new FILE("path to your file"));
Call<APINAME> fileUploadCall = App.getRestClient(context.this).getApiService().uploadfile(requestBody); imageUploadCall.enqueue(new Callback<APINAME>() { @Override public void onResponse(Response<APINAME> response, Retrofit retrofit) { if(response.body().getSuccess()) { } } @Override public void onFailure(Throwable t) { try { Log.e("Upload","false"); throw t; } catch (Throwable throwable) { throwable.printStackTrace(); } } });
The text was updated successfully, but these errors were encountered:
Dupe #1140
Sorry, something went wrong.
No branches or pull requests
Trying to upload Image File Using retrofit but Couldnt do it so i found Some work around
For retro fit Call
@multipart
@post("END_POINT OF API")
CalluploadFile(@part("xyz(Filename)";filename="image.*(type of file)" ") RequestBody xyz);
when You Call it using in your App
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"),new FILE("path to your file"));
The text was updated successfully, but these errors were encountered: