How to upload file with relative path [duplicate]

余生颓废 提交于 2019-12-08 13:50:35

openFileInput(url); can not open file stored on sdcard. this method is used to Open a private file associated with this Context's application package for reading.

you must use new File(path) method to create or open a file. then use appropriate InputStream. can refer below syntax..

File dir = Environment.getExternalStorageDirectory();
File yourFile = new File(dir, "path/to/the/file/inside/the/sdcard.ext");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!