Inputstream instream = NULL;
// Connect to the specified network resource and obtain the network input stream. Conversion is required here. Otherwise, an error of NULL pointer will be reported in getinputstream () below.
Ftpurl = ftpurl. replaceall ("%", "% 25"); // convert the % contained in the address to % 25 ftpurl = ftpurl. replaceall ("", "% 20"); // convert the space to % 20url u = new URL (ftpurl); con = u. openconnection (); system. setproperty ("sun.net. client. defaultconnecttimeout "," 60000 "); // change jdk1.4 to this value, and the connection times out. system. setproperty ("sun.net. client. defaultreadtimeout "," 60000 "); // replace jdk1.4 with this, and the read operation times out. Con. connect (); instream = con. getinputstream ();
However, the content can be read in this way, but this address with a percent sign is still a problem when the front-end shows that the link is opened, in IE6, you can click to download, but in a high-version browser, you may not be able to download it.
I don't know any good solutions ..
This article from the link: http://www.zhqhlbt.com /? P = 238 | blog of little Z