java - android cannot get download file -
i using eclipse , xampp android assignment, have code download txt file in localhot folder, keep saying
java.io.eofexception this folder directory, inside directory got 1 txt file called movie queue.txt
c:\xampp\htdocs\android\uploads\u0001\public this url
string url = "http://10.0.2.2/android/uploads/u0001/public/movie%20queue.txt this code
url u = new url(url); urlconnection conn = u.openconnection(); int contentlength = conn.getcontentlength(); datainputstream stream = new datainputstream(u.openstream()); byte[] buffer = new byte[contentlength]; stream.readfully(buffer); stream.close(); dataoutputstream fos = new dataoutputstream(new fileoutputstream(dest_file)); fos.write(buffer); fos.flush(); fos.close(); the error happen @
urlconnection conn = u.openconnection(); int contentlength = conn.getcontentlength(); can me solve it?
i sure , found error save file name without space , download file download because had problem upload file without space in file name , download it....
http://10.0.2.2/android/uploads/u0001/public/movie**%20**queue.txt in %20 mentioning space upload , download solution..all best
Comments
Post a Comment