(how) can I download an image using JSoup?

I didn’t even finish writing the question before I found the answer via JSoup and a little experimentation.

//Open a URL Stream
Response resultImageResponse = Jsoup.connect(imageLocation).cookies(cookies)
                                        .ignoreContentType(true).execute();

// output here
FileOutputStream out = (new FileOutputStream(new java.io.File(outputFolder + name)));
out.write(resultImageResponse.bodyAsBytes());  // resultImageResponse.body() is where the image's contents are.
out.close();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)