Weird download file problem
I'm trying to download a pdf from a website but it doesn't work.
When i try any other website it works, but with this, it doesnt.
I try to download a pdf but instead i get the html content of the home page.
However, if I use a download manager and import the link, the download manager can get the pdf instead of the homepage.
Here's the code:
Any help is appreciated because I've searched alot but didn't find anything
URL localURL = new URL("http://krant.tijd.be/pdf/tijd/20100522/1/paper.pdf");
InputStream localInputStream = localURL.openStream();
InputStreamReader localInputStreamReader = new InputStreamReader(localInputStream);
FileOutputStream localFileOutputStream = new FileOutputStream("C:/Users/Glenn/4.pdf");
OutputStreamWriter localOutputStreamWriter = new OutputStreamWriter(localFileOutputStream);
while ((i = localInputStreamReader.read()) >= 0)