HttpUrlConnection GetInputStream()

I am working on a Linux machine coding in Java... I am using HttpUrlConnection GetInputStream() to download files from a site

The problem is that it will only download files with certain extensions, such as .txt, mpeg, sql and so on.
But I need to download many media files such as .flv, .avi  
I realise that .flv and .avi is not recognised on my Linux machine, because when I type in Http:// in the browser, it comes back with page not found.

how can i get around this problem?

Many thanks...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Veriy that the file truly exists.   Double check capitolization.  
You can also try the command:  wget

There are many ways to obsfucate locations of files.

zeraxis_eeAuthor Commented:
Thanks... you were right about the .avi.

However, the problem still remains. If I am trying to download files where the file type is unknown, it will not download. For example .flv .properties etc.

I double checked that the files exist in the file system, but when I am trying to open in the browser, because it is unknown file type... I get page cannot be found. The web application, where the files are being downloaded from is running on IIS... I am guessing I need to set something on IIS to recognise those files.

Any ideas?


This is a default setup for IIS.   Unknown file types are not served.

Here is the Microsoft KB article on how to create an generic unknown mime type to allow fro download via octet-stream.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.