Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- URL website = new URL("http://www.website.com/file.exe");
- ReadableByteChannel rbc = Channels.newChannel(website.openStream());
- FileOutputStream fos = new FileOutputStream("file.exe");
- fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
- URL url = new URL(fileURL);
- HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
- httpConn.addRequestProperty("User-Agent", "Firefox 5.0");
- httpConn.setRequestProperty("Referer", "http://www.google.com");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement