Downloading images and audio file using java

Dear All
I have a directory on my webserver which contains images,audio files and many other data files.
I want to download all the file but the problem is when i download image and save it, it is not viewable. I dont want to use Image class as i may have to downlaod audio files too. Please guis which stream shouldi open to download any kind of content using same code.
Thanks in advance. And if u have some example please let me know
Regards
Jafery

downloading images and audio file using java -------------------------------
how to write it back to dataoutputstremI don't understand what you are talking about.
Server: DataOutputStream -> Client: DataInputStream -- the two is a pair.

Similar Messages

  • Images and audio files in a database

    how does one put images and audio files in oracle 8? What are the data types going to be in the tables for images and audio files..?
    null

    One of the most important reasons that one would choose to store multimedia in the database is to be able to manage this content safely and efficiently. Having multimedia in the database allows you to use database itegrity techniques to keep your data safe and consistent. If you choose to use BFILE storage, you will NOT have these advantages. You will have to back up the database, and the filesystem(s) where the multimedia is stored, and devise a way to keep this data consistent. You will not be able to rely upon the database backup entirely, you would need filesystem backups to be coordinated with database backups.
    I would suggest that you store the multimedia in BLOBs within the database.
    From the LOB application developer's guide:
    * External (BFILE) LOBs do not participate in transactions. Any support for integrity and durability must be provided by the underlying file system as governed by the operating system.

  • How to create table and insert images and audio files ...

    hello to all , i am doing my b.e cse .
    at current v r studing DB and pl/sql codes ....
    i just need to know simple way of code to insert images and audio files in a table .
    i tried some of these ,
    CREATE TABLE myTable(Document varbinary(max))
    INSERT INTO myTable(Document)
    SELECT * FROM
    OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB)
    but not workiing
    it shows some errors.
    i use oracle 10g. thank u :) and also i tried using blob and bfile datatypes , table created but cannot insert values !
    ROBOK

    hello to all , i am doing my b.e cse .
    at current v r studing DB and pl/sql codes ....
    i just need to know simple way of code to insert images and audio files in a table .
    i tried some of these ,
    CREATE TABLE myTable(Document varbinary(max))
    INSERT INTO myTable(Document)
    SELECT * FROM
    OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB)
    but not workiing
    it shows some errors.
    i use oracle 10g. thank u :) and also i tried using blob and bfile datatypes , table created but cannot insert values !
    ROBOK

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • How to download video and audio files

    Pl tell me how to download mp3 & mp4 files from fox browser

    hello afrozahamed, please have a look at the following article which should cover your question: [[How do I download music, photos and videos from the browser?]]

  • Query on processing a PDF file using Java mapping

    Hi All,
    i am trying to process a XML and PDF file using Java mapping, it is successful in XML but unable to do for PDF.
    below is the code i am using... can any one guide me how to process PDF's..
    byte byte1 = 0;     
    java.io.ByteArrayOutputStream bos = (ByteArrayOutputStream)outputstream;
    while((byte1=(byte)inputstream.read())!=-1){
    bos.write(byte1);
    bos.close(); 
    Thank You,
    Madhav

    Hi Madhav,
    I think instead of going with JAVA mapping you can write a custom adapter module for it.
    Ref:  /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter
    Also check : Re: PI 7.1 : Taking a input PDF file and mapping it to a hexBinary attribute
    /people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi
    Thanks,
    Edited by: Hareenkumar on Dec 21, 2010 11:12 AM

  • Tiff image and pdf file

    Hi,
    I am working with project that requires showing different types of images and pdf files using oracle ADF components. It was so easy to show jpeg and gif, for example, using objectMedia. I tried to use the same component, objectMedia, to show tiff image, but it didn't work and I was unable to find suitable component to show pdf file.
    Is there anyone some can help me in showing tiff image and pdf file.
    Alice

    Correction, PDF is not required to be geneated, but displayed.
    Display PDF and tiff with af:objectImage ?
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/objectImage.html

  • Website image and zip file download links not working in Dreamweaver Air application

    Hi
    I have successfully created and AIR app for an existing business website using the Dreamweaver AIR Extension. The site works very well in all respects except for the part where we have high resolution images and zip files available for download. The download links refuse to do anything, and right-click (PC) / ctl-click (Mac) does nto work either.
    I suspect this may be an AIR sandbox/security issue but am I correct and what can I do to fix it?
    Thanks in advance for any assistance you may be able to give.
    Martin

    I am now facing the same problem. I wrote a servlet .
    code like this
             response = (HttpServletResponse) faces.getExternalContext().getResponse();
             response.setContentType("application/x-download");
             String agent = request.getHeader("USER-AGENT");
             boolean isIE=false;            
            if (null != agent && agent.indexOf("MSIE")!=-1) { 
                isIE=true;
            if (isIE) {
                fileName = URLEncoder.encode(fileName, "UTF-8");
            } else {
                fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
            response.setHeader("Content-Disposition","attachment;filename="+fileName);
            ServletOutputStream os = response.getOutputStream();
            byte b[]=new byte[1024];
            int n;
            while((n=in.read(b))!=-1){
                os.write(b,0,n);
           in.close();
           os.close();
    and i open a new window refer to above jsp ,also i set a breakPoint at os.close(),the program has passed through,but nothing happened in the window.
    If i use IE or FF ,the browser will open a small window to allow me select whether open or  save the file.So can anybody give me some advice.Is it because air using webkit engine and the engine does not do this kind of job?
            Thanks.

  • How to download and upload files in Java?

    Hi, everyone
    How to download and upload files in Java? Do you have some references about this issue or some valuable web link�? Thanks!
    Best Regards,
    Hai.Ren

    This is too vague a question, please be more specific. What protocol would you like to use? HTTP? FTP? Something else?

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Code for reading the and placing the file using java webservice

    Hi All,
    Can anybody can guide me on how to read a file and place the file using java.
    Let  me know if any code is available which has been completed using java.
    Regards,
    Rahul

    Hi,
    The "square" symbol that you are referring to is probably a CRLF (Carriage Return - Life Feed) Control Character.
    This is more commonly known as a "Enter" at the end of a line / sentence.
    To clean this character from strings in Java, please use:
    String patternStr = "(?m)$^|[\\r\\n]+\\z";
    String replaceStr = " ";
    Pattern pattern = Pattern.compile(patternStr);
    Matcher matcher = pattern.matcher(inputStr);
    return matcher.replaceAll(replaceStr);
    Hope that helps.
    Thanks.
    p256960.

  • I am trying to use the auto audio-sync feature. When I select the video and audio clip to be synced FCPX says its syncing them and then once finished (at 100%) no compound clip is created and the video and audio file do not sync. Any help is appreciated.

    I am trying to use the auto audio-sync feature. When I select the video and audio clip to be synced FCPX says its syncing them and then once finished (at 100%) no compound clip is created and the video and audio file do not sync. Any help is appreciated.

    Hi
    In iMovie'11 (version 9.0.x)
    on top menu row - Apple/iMovie/File/Edit/Cut (Can vary dep. on language - in Swedish Apple/iMovie/Arkiv/Redigera/Klipp . . . )
    down Cut menu - Slow playback/Raspid Playback/Re-play in Slow Motion and onvards
    Here one can select the Pre-Set speeds
    Are you familiar with getting 'inspector' to run?
    No - but I guess that Double Click on clip/sequense or ctrl-Click on it might open it.
    Yours Bengt W

  • Want To create Zip file  using java,And Unzip without Java Program

    I want to create a zip text file using java, I know Using ZipOutputStream , we can create a zip file, , But i want to open that zip file without java program. suppose i use ZipOutputStream , then zip file is created But for unZip also difftrent program require. We cant open that zip file without writing diff java program.
    Actually i have one text file of big size want to create zip file using java , and unzip simply without java program.Its Possible??
    Here is one answer But I want to open that file normal way(
    For Exp. using winzip we can create a zip file and also open simply)
    http://forum.java.sun.com/thread.jspa?threadID=5182691&tstart=0

    Thanks for your Reply,
    I m creating a zip file using this program, Zip file Created successfully But when im trying to open .zip file i m getting error like "Canot open a zip file, it does not appear to be valid Archive"
    import java.io.*;
    import java.util.zip.*;
    public class ZipFileCreation
         public static void main (String argv[])
         try {
         FileOutputStream fos = new FileOutputStream ( "c:/a.zip" );
         ZipOutputStream zip = new ZipOutputStream ( fos );
         zip.setLevel( 9 );
         zip.setMethod( ZipOutputStream.DEFLATED );
    //     get the element file we are going to add, using slashes in name.
         String elementName = "c:/kalpesh/GetSigRoleInfo092702828.txt";
         File elementFile = new File ( elementName );
    //     create the entry
         ZipEntry entry = new ZipEntry( elementName );
         entry.setTime( elementFile.lastModified() );
    //     read contents of file we are going to put in the zip
         int fileLength = (int)elementFile.length();
         System.out.println("fileLength = " +fileLength);
         FileInputStream fis = new FileInputStream ( elementFile );
         byte[] wholeFile = new byte [fileLength];
         int bytesRead = fis.read( wholeFile , 0 /* offset */ , fileLength );
    //     checking bytesRead not shown.
         fis.close();
    //     no need to setCRC, or setSize as they are computed automatically.
         zip.putNextEntry( entry );
    //     write the contents into the zip element
         zip.write( wholeFile , 0, fileLength );
         zip.closeEntry(); System.out.println("Completed");
    //     close the entire zip
         catch(Exception e) {
    e.printStackTrace();
    }

  • Recording video/audio files using Flash Meida Server through rmtp, and allow users to access the recorded files through http.

    As titled, what is the way to record video/audio files using Flash Meida Server through rmtp, and allow users to access the recorded files through http?
    What I am trying to do, is to record a user's microphone's input and save it to the server. Afterwards, I would like other users to be able to access the recorded files and mainuplating the audio data, by computeSpectrum(), to do some visualization of the audio. As I know computeSpectrum() cannot work on streaming files, so I think I need to access the recorded files using http instead of rmtp. Is that true?
    How can I redirect the http request to the files I was recorded into my applications/appName folder? Or I need to somehow moved the recorded files to the /webroot folder?
    Thanks!

    I probably have asked a stupid question.
    My recorded streams are still saved in the applications/appName/streams folder.
    And I redirect the www.mydomain.com/streams to point to the applications/appName/streams folder.
    And the rmtp recorded streams are abled to connect through http now.

Maybe you are looking for

  • Use of SQL*Loader and Thin Client

    I have a java application that is currently using the thin client. For portability issues, I am unable to use an OCI driver. My application also uses SQL*Loader. My big issue is that The Thin client requires the HOST and SID for a connection. But, fo

  • XML support in Tux 7.1

    Hi, Has anyone used XML features of 7.1? I am not sure why the Tux documentation is so weak on this topic. All it says is that it supports XML data type and DDR for the same. How come there is no sample for the usage considering it is a new data type

  • HSS "Deployment Metadata" export (partly) fails with 4 error messages:

    The "Deployment Metadata"-export fails. It fails both on HSS user interface or via the LCM utility on the foundation server and on a non foundation machine. Perhaps its due to the fact that we have 3 essbase servers with a couple of essbase applicati

  • Dimension Account as Secure

    For me to be able to asign security by member in a account dimension, i need to set it as READ and WRITE. However when i do that i can't run any allocation, even if the user have a profile with all taks profile permitions (read and write) in all memb

  • Sound turns off

    After watching a Clip from Youtube on my tv the Sound from watchever or Other Apps doesnt work anymore. Is it a Problem from my Apple TV or from my Television ?