如何将PDF文件上传到Android中的服务器? [英] How to upload a PDF file to server in android?
本文介绍了如何将PDF文件上传到Android中的服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我提到了一些以前的问题,但没有得到适当的解决方案.我正在创建一个应用程序,并希望通过从文件管理器中选择PDF文件来发送它.
I referred some previously asked questions but not get proper solution.I am creating an Application and want to send PDF file by selecting it from File Manager.
感谢任何帮助.
推荐答案
仅当必须从图库中选择PDF文件时,才需要更改此代码行. intent.setType("application/pdf") 这只会搜索图库中的PDF文件.
Only you have to change this lines of code when you have to select PDF file from gallery . intent.setType("application/pdf") this will search only PDF files from gallery.
Intent intent = new Intent();
intent.setType("application/pdf");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Pdf"), PDF);
这篇关于如何将PDF文件上传到Android中的服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文