Problem downloading big size files

Hi,
I am trying to add on my web application an hyperlink to let the user download a compressed file.
I am using the servlet to perform the transferring of the file.
Everything works perfect when the size of the file is small, otherwise I get a file smaller than the original one and the archive results to be corrupted.
Is there a limit somewhere on the hyperlink component or elsewhere?
To perform the transfer I am using the following object:
public class DownloadZip {
    /** Creates a new instance of DownloadZip */
    public DownloadZip(String fname, String mtype) {
        FacesContext faces = FacesContext.getCurrentInstance();
        HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
        try{
        ServletOutputStream outputStream = response.getOutputStream();
        String filename = fname;
        String mimetype = mtype;
        if(mimetype == null || mimetype.length() == 0)
            mimetype = "application/octet-stream";
        response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
        response.setHeader("Cache-Control", "cache");
        response.setHeader("Cache-Control", "must-revalidate");
        response.setHeader( "Pragma", "public" );
        File results=new File(path_name+filename);
        response.setContentLength((int) results.length());
        response.setContentType(mimetype);
        FileInputStream in = new FileInputStream(results);
        BufferedInputStream fis = new BufferedInputStream(in);
         int i = fis.read();
        while (i !=-1)
     try
             outputStream.write(i);
          i = fis.read();
     catch(IOException e)
          e.printStackTrace();
          break;
    outputStream.flush();
    fis.close();
    outputStream.close();
    catch(IOException e)
          e.printStackTrace();
}Please tell me what I am doing wrong.
Eva.

Yes. This is an issue. JavaFX team is working on enhacing HttpRequest API so as to allow huge data transfer. There are couple of new attributes added which will allow to do data transfer without buffering. Also Integer (used in may APIs) will be changed to use Long (new supported data type) to handle larger data. These changes will be available in next release - 1.2

Similar Messages

  • How efficiently Big Size file can be processed

    Hi,
    I am given a specific problem for Big size Matrix data handling.
    In a File there are Huze data in the Matrix form (m*n) - These data basically represents some image pixel value.
    say for example I am give a pixel value of leena image of size 5MB.
    What should be the efficient logic for faster reading of the File and put it in a Data Structure,
    What should be the efficient Data structute to hold that huge data (data range varry from 0-255)
    Thank you
    shankha

    Do you want to know how to load an image? http://java.sun.com/docs/books/tutorial/2d/images/index.html
    BTW, 5MB isn't "huge".

  • Problems downloading large video files...

    *I get the following error message whenever I try to download a video file that is larger than 2gb:*
    There were problems downloading some purchased items.
    For more information on the items that could not be downloaded, click below.
    There was a problem downloading “A-Rod's 500th Home Run / MLB.com Games of the Year / MLB.TV Game of the Year MLB.com”. An unknown error occurred (-50).
    Please check that the connection to the network is active and try again.
    *Is there something I need to adjust so that I can download these files??? I'm guessing that it is related to the size of the file, as 1.96gb file doesn't have a problem, while a 2.03gb file does.*

    I tried contacting the store support, with no luck. They suggested that the problem was caused my either my ISP or my firewall, and has nothing to do with iTunes. I have since contacted McAfee, who has informed me that there is no way their firewall would limit the size of downloads. Embarq (my ISP) has also informed me that they have no way of limiting the size of my downloads.
    I'm stuck between a rock and a hard place. Does anyone else have any ideas????

  • Problems downloading multiple ftp files

    Hi community!
    I'm new to this board, and i've joined because I got a severe problem. I need to download some thousands of files the path of which I'v got stored i an SQLServer Database. So, i'm just running through my db and for every line I download a single file from the server. That works cool, except for: the following code runs only once! At the moment I call the get() command within the loop for a second time, the whole process is blocking, waiting.
    String path = null;
    int b = 0;
    ftpc = new sun.net.ftp.FtpClient("theserver");
    ftpc.login("anonymous", "[email protected]");
    ftpc.binary();
    rs = st.executeQuery("thequery");
    while (rs.next() && ftpc.serverIsOpen()) {
    path = rs.getString("path"); // fetching the next path
    is = ftpc.get("/" + path); // IS is a TelnetInputStream
    fos = new java.io.FileOutputStream("h:\\temp\\" + path.substring(path.lastIndexOf("/")));
    while ((b = is.read()) != -1)
    fos.write(b);
    fos.close();
    Does anyone have any idea????
    please, if anyone could help me with this, i'd be really thankful. Any help is appreciated. Thanx in advance!

    JavaWorld published an article about this topic. It is called "Java FTP client libraries reviewed" and it can be found here :
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
    Best regards
    Jean-Pierre Norguet
    Jean-Pierre Norguet
    JavaWorld Press
    http://wasa.ulb.ac.be/jp.html

  • Problems downloading DP4 zip file

    Im having problems downloading the DP4 zip file. When the download ends, i cant open the zip file.
    Any help?
    Txs

    Marco,
    I have not had any similar complaints and have spoken to many customers successfully using DP4. It may have been an issue on our side. Please let me know if it persists.
    Doug

  • I can't copy big size files to my 1TB external after lion up

    I have a 1 TB external HDD, 2 partitions a 174.5GB MAC OS EXTENDED used as a backup and an 825.23 MS-DOS(FAT32) for everything else. before i upgraded to LION it works fine. after LION i copy a 800MB movie file to either of the 2 partitions it shows the file being copied and the gray file icon is there  but after the process is complete the file isnt there and the HDD size doesnt change. while when i try to copy a 7GB file to either of the partitions this message appeares (The item “123.mkv” can’t be copied because it is too large for the volume's format).
    am using a macbook 13" dual core 2.4ghz 4gb ram. ---
    i tried my brother's HDD and i faced the same issues. however on his MBK its fine.
    i honestly don't want to try and restore before LION and do the process again coz i would have to download LION again, and i also can't transfer the files on the external HDD coz its too big and i don't have anywhere to put them.
    if anyone has a solution please do post. otherwise i would have to re-do 30hrs woth of work again coz its not backed up
    thanx

    HI,
    That's kinda strange, i really believe i have tried to copy files larger than 4GB to the HDD before on leopard, but maybe am confused on that.
    i repaired the permissions on all the HDDs even the enternal one.
    and i actually tried a document file of maybe 60KBs and the same thing on both partitions.
    i think the good news is that i checked on the backup of TimeMachine and yep it backedup files "weooh" i tried and created files on my own and checked the back up and its there.
    the weired thing is when i try to copy those same file my self ( Drag n Drop or Copy n Paste) its not working on either partition.
    i would really appreciate a solution where i wont have to restore to leopard and re-install lion, i would be happy to provide who you with more detail if you might be able to help
    cheers,
    Anas

  • Illustrator cc 2014 dosen't open old big size file Black screen and crashing

    I installed illustrator cc 2014 I can not open some of my old files... black screen on waiting....  Meanwhile writes above is not responding If file size is larger it's a problem My OS Windows 8,1 pro "Please help"

    Hi,
    This seems to be activation issue,
    Please sign out from Creative cloud desktop app and Quit it.
    quit all the Adobe applications
    Assuming you're on Windows machine
    Go to the following location and rename Adobe folder to old.Adobe
    C:\Users\<Username>\AppData\Roaming
    C:\Users\<Username>\AppData\Local
    Then try to launch Creative Cloud Desktop app and Sign in with your Adobe ID and Password.
    and Launch Premiere pro, hope that helps.
    Thank you,

  • Problem downloading .doc, .xls file using servlet

    i have a servlet which downloads the files to client(browser). It works file for .txt file but .doc, .xls files are opend but they contain garbage.
    plz letr me know if u know problem!!!!!
    -amit

    Probably because you output them using the Writer you got from getWriter instead of using the OutputStream you can get from getOutputStream.

  • Having a problem downloading a pdf file onto sony reader.

    Process:
    I have the Reader connected to the computer.
    I have downloaded the books form Waterstones which went into Adobe Digital Editions.  There hasn't been a problem here.
    I have opened the eBook Library, went to file, import files, my documents, Adobe Digital Editions and clicked on the book I want to put on the Reader.  The book uploads into the eBook Library.  I then Drag and drop the book on the Reader link on the left hand column.  The status rotates as if the book is being transferred however I then have an error message reading:
    'To transfer this ebook, you must first authorize the reader for Adobe DRM protected content.  Do you want to authorize the reader now?'
    I click yes.
    I type in my Adobe Id and password as I am asked to do and click yes.
    Another error occurs reading:
    'Failed to authorize this PC to the eBook store.'
    I can only click yes here which leaves me where I started.
    If I go onto the Sony eBook store it doesn't show me the 'Register' link at the top of the page.
    I had 7 ebooks on the reader since July so it was all working perfectly until 5/09/09 when i bought another 2 from Waterstones.  When I tried to put them on it deleted the first 7.  When I had the 2 new books on, the old 7 deleted and when I had the first 7 on the Reader it didn't allow me the 2 newer books I bought on 5/09/09.  Now I can't get any of the books to transfer onto the Reader.
    My sister is also experiencing the exact same problem as I am having.  However when she downloads a free book from Sony, it transfers no problem, it just seems to happen with the ebooks we have paid for.  She is using the software which was supplied with the product wereas I am using an updated version.  Between the two of us, we have purchased 12 ebooks and can't get any of them to work on either Reader.
    Can anyone help??

    Adobe aren't much help either. What you have to do is open a web case with the Adobe support team.
    I've been waiting since 25/09/09 for them to reset my account which is what you have to do to get it working again.
    I know this isn't much help but its a start.
    Hopefully it works for both of us if they ever reset the account.

  • Can't download big pdf files after upgrading to ios7.

    Safari closes itself every time I try to download PDF file bigger than about 50 MB. I never had any crashes with IOS6 with my iPad2 before. And yes, I've tried all cold boot and reset tricks.

    Report the problem to Apple at http://www.apple.com/feedback/ipad.html

  • Problems downloading a program/file off the internet, end up as Excel files

    When I attempt to download a program or a file off the internet, and save it to disk it appears as an unreadable excel spreadsheet on my desktop. What is going on?

    Hi, Mary.
    1. Can you provide an example, such as a URL / link to a file you have attempted to download?
    2. See my "Resetting Launch Services" FAQ.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • There was a problem downloading song. The file seems to be corrupted.

    Hi
    I'm trying to download an album i purchased but i'm constantly getting the message "There was a problem downloading X. The file seems to be corrupted" for every song I try to download. Also if i try to stream the song it says "This computer is not authorized to play X. Would you like to authorize it". But my computer is already authorized and when I try to authorize it again, it says this computer is already authorized.
    I've tried downloading them through the purchased section of the store (which causes itunes to crash 50% of the time) with no luck. I've also reinstalled itunes. This only started happening once I installed the latest version of itunes.
    Any help would be appreciated

    I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not downloading properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • Efficient Time effective algorithm to read a BIG Size Image matrix

    Hi,
    I am given a specific problem for Big size Matrix data handling.
    In a File there are Huze data in the Matrix form (m*n) - These data basically represents some image pixel value.
    say for example I am give a pixel value of leena image of size 5MB.
    What should be the efficient logic for faster reading of the File and put it in a Data Structure,
    What should be the efficient Data structute to hold that huge data (data range varry from 0-255)
    Thank you
    shankha

    It rather depends what you want to do with the data. For most purposes, I'd imagine that that the standard image libraries are pretty good.

  • Problems downloading Premiere Element 12

    I am from Hong Kong and I have purchased and paid for by credit card the above software from official Adobe website, however, when I attempted to download the total Four (4) files, I experienced very very slow download speed.  I managed to completely download the following, all only 1.5MB in size:
    PremiereElements_12_WWEFDJ_win64.exe
    PremiereElements_12_WWEFDJ_win32.7z
    PremiereElements_12_WWEFDJ_win32.exe
    However, I have problems downloading the final file:
    PremiereElements_12_WWEFDJ_win64.7z
    This is 1.5GB in size and showed me a download time of about 20 hours!
    I'm using Fibre-To-The-Home 500MB Broadband Service at home so there should be no problem at all downloading only 1.5GB, it normally takes less than 5 minutes or so to download similar size files.  So I rebooted my computer several times and tried again, now Adobe is saying I'm only allowed 5 attempts to download and I have exceeded that amount!!  This is effectively blocking my download!
    I would be very gratedful if you could help me rectify this problem and explain to me why the download speed is so slow!  It really should not take 20 hours to download a software!
    I am using Windows 7 Home Premium (64-bit)

    Go here:
    http://helpx.adobe.com/uk/premiere-elements/kb/premiere-elements-10-11-downloads.html

  • Downloading a pdf file from javascript() window does not work

    PDF download/view works fine where the link points to actual pdf file. But I have problem downloading/viewing pdf files that are loaded using javascript(), e.g. bank statements and such. When I click a link FF downloads a file which either has no extension or has a different one (not .pdf).
    Later I realized that I can manually rename the downloaded file to insert .pdf extension and open it in reader.
    How can I solve this? I don't have this problem when using IE or Chrome.
    Thanks

    Could you try a new profile?
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem.
    http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    If it still happens with a new and clean profile then the most likely cause is that you have security software that is blocking this JavaScript.

Maybe you are looking for

  • Error while posting parked doc

    Hi friends I am getting the following error while posting a parked doc- Field BSEG-SECCO. does not exist in the screen SAPMF05A 0303 It is actually asking for the Section Code which does not appear in the screen. I am wondering where I can set the Se

  • HELP AUTHORIZATION ISSUE

    So I've only ever connected my ipod to my macbook, never to another computer, and I never authorized my ipod with my computer or anything because I would download apps with wifi and i would be fine. I downloaded some music with my ipod the other day

  • Placing text inside curved shape

    i am having bit trouble placing the text inside this custom shape (i used custom shape tool) I followed one of the post found here Fitting text inside a custom shape but i couldn't get any results at all. Would someone maybe try to give me exact inst

  • Win 7 install freezes I975Xa-YDG/T7200

    I have tried installing the Beta and RC versions, 32 and 64 bit, none of which will get beyond 1% "Expanding files" before the system locks up completely. Even simply booting from the DVD and doing absolutely nothing once the blue screen appears, wil

  • Program error RSAR245

    Hello all I'm trying to activate transfer rules 0COMP_CODE_TEXT but it produces an error: "Error generating program Message no. RSAR245 An error occurred during program generation: Template:   RSTMPL80 Error code: 6 Row:        1.126 Message:    The