HttpUrlConnection  GetInputStream()

Posted on 2008-11-14
Last Modified: 2012-05-05
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...
Question by:zeraxis_ee
    LVL 9

    Expert Comment

    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.


    Author Comment

    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?

    LVL 9

    Accepted Solution


    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.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now