0
我想知道如何從URL獲取文件名,以便它可以下載到SDCARD而不覆蓋新文件。來自URL的文件名(覆蓋)
int lenghtOfFile = conexion.getContentLength();
Log.d("ANDRO_ASYNC", "Lenght of file: " + lenghtOfFile);
String fileName = "test.epub";
InputStream input = new BufferedInputStream(url.openStream());
OutputStream output = new FileOutputStream("/sdcard/"+ fileName);