[英]How to upload image file from Android to ASP.NET(Web Services- ASMX) upload folder using Retrofit
Please help me to provide me the solution for that because I have tried many codes and I had referred many tutorials but everyone shows different results. 请帮助我为我提供解决方案,因为我尝试了许多代码,并且参考了许多教程,但每个人的结果都不一样。
So please help me, anyone 所以任何人请帮助我
You can try Using Koush ION, Here is the GitHub , also can you expand your question is there any errors what is the problem exactly ......next time you ask a question you should add code snippets and a full explaination of the issue... you will have a better chance of recieving a answer.....SO in koush ION its easy to use implement the library with 您可以尝试使用Koush ION, 这是GitHub ,也可以扩展您的问题,如果有任何错误,究竟是什么问题……下一次您提出问题时,您应该添加代码段和完整的解释问题...您将有更好的机会获得答案.....在koush ION中,它易于使用,实现了
implementation 'com.koushikdutta.ion:ion:2.2.1
and then call it with 然后用
Ion.with(SecondActivity.this)
.load(myURL)-Enter your URL here
.uploadProgressDialog(pd)
.setMultipartFile("pdf","pdf/*",filePath )-here you set the type and location of the file
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() { - here you get results from the server using a json array/object
@Override
public void onCompleted(Exception e, JsonObject result) {
String message = result.get("message").getAsString();
Toasty.info(SecondActivity.this, message, Toast.LENGTH_LONG).show();-here i use the Toasty library for awesome looking toast messages
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.