简体   繁体   English

如何使用Retrofit将图像文件从Android上传到ASP.NET(Web Services- ASMX)上传文件夹

[英]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.

相关问题 如何使用Retrofit在Android中调用图像上传Web服务(ASP.NET).asmx文件 - How to call the Image upload web service (ASP.NET ) .asmx file in android using Retrofit android文件上传,带有对asp.net Web API的改造 - android file upload with retrofit to asp.net web api 将图像从Android上传到asp.net - Upload Image from Android to asp.net 如何使用(asmx).net WebService从Android上传文件 - How can i upload file from Android using (asmx) .net WebService Retrofit2 Upload Using RequestBody 返回 400 Bad Request (Android Kotlin MVVM &amp; ASP.NET Core Web API) - Retrofit2 Upload Using RequestBody returns 400 Bad Request (Android Kotlin MVVM & ASP.NET Core Web API) 带有翻新功能的Android摄影机上传-ASP.NET MVC端点 - Android Photo Camera Upload with Retrofit - ASP.NET MVC Endpoint 如何使用改造和.net核心从Android上传几个图像? - how to upload several images from android by using retrofit and .net core? 将图像从Android上传到ASp.net服务器 - Upload Image From Android to ASp.net Server 将图像从Android手机上传到Asp.net服务器 - Upload image from android phone to the Asp.net server 如何将图像从android改造上传到服务器 - How to upload Image to server from android retrofit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM