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

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -