How to download file from internet in java -


i have problem when want download file internet in java. try used this:

    string stringurl = "http://imageshack.us/a/img841/7762/formd.png";     file file = new file("");                try {             url url = new url(stringurl);             fileutils.copyurltofile(url, file);         } 

but got i/o exception. best way download file internet , put 'file' object?

that's because haven't given file name, , writing file no name makes no sense.

file file = new file("");   

if replace line like:

file file = new file("x.png"); 

...then should work.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -