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

Similar Messages

  • Download multiple Collaboration files

    We are using Collaboration 4.0.2.
    I am wondering whether the PRC can be used to download all the documents from a specific project?
    This is so we can cleanout the project while still retaining a knowledge base of learnings from old projects.
    Thanks.....

    Hi,
    I'm actually trying to generate multiple excel files at once,
    looping though a query and creating the files.
    However, when I launch the code, it is generating only the
    last file and not one by one.
    I unfortunately cannot use POI in this case because of heavy
    formatting of the excel files (tables, colspans, rowspans, colors,
    etc), unless you know of a way to do this with POI?
    Initially the files were generated 1 by 1. This works, no
    problem.
    But now, the users want the option to tick which files they
    want to generate and click on a Submit button to generate all the
    Excel files they have checked.
    Any idea on this issue?
    Pls also advise how you managed to delay the form submission
    by 10 seconds for each of the files you were creating.
    Thanks and regards,
    Yogesh Mahadnac

  • Download multiple XML files from SXMB_MONI and / or RWB

    Hi
    Does anyone have a clever way to download multiple inbound / outbound XML messages from either SXMB_MONI and / or RWB. For example, I send in 100 XML files to XI. These are mapped to an IDOC. I want to download all 100 source and target XML messages 'easily' versus drilling into each and using 'Download Window 1' or 'Download Window 2'.
    Any ideas are much appreciated.
    Thx
    Duncan

    Hi Jörg,
    I try to use class CL_XMS_PERSIST with method READ_MSG_ALL but I can't find the content of the Payload in EX_MESSAGE...
    Can you help me please ?
    Thank you.
    Elisabeth.

  • 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

  • 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????

  • Problem downloading multiple images in bytearray, Help !

    Hi Everyone,
    I m trying to download multiple images on my mobile as a part of my application.
    On server side I have used System.arraycopy to merge arrays..
    What I did on server side is as follows:
    byte[] seperator={'%'};
    totalImageArray=image1+seperator+image2
    Please note everything is in bytearray.
    Now on client side I m not able to extract two images seperately i.e. bytes before seperator and after seperator.
    how do i do byte to byte comparison ?
    Please guide me as to how I should do this..tips links snippet...??
    Message was edited by:
    siddhsdesai

    Wht dont you send images seperate...
    For example first write the size of first image as bytes and than write the first image. Then write the size of second image as bytes and than write the second image.
    In the client side first read the first number and then read as many as that bytes then create first image. Then read the second number and then read as many as that bytes then create second image.
    Server Side...
    DataOutputStream toClient = new DataOutputStream (....);
    toClient.writeInt(...); //send the sizeof first image as bytes
    toClient.write(...);  //send the first image as byte array
    toClient.writeInt(...); //send the sizeof second image as bytes
    toClient.write(...);  //send the first second as byte array
    toClient.flush();Client Side...
    DataInputStream fromServer= new DataInputStream (....);
    int firstsize=fromServer.readInt(); //read the sizeof first image as bytes
    byte[] image1data=new byte[firstsize]; //image1 buffer
    fromServer.readFully(image1data);  //read the first image as byte array
    int secondsize=fromServer.readInt(); //read the sizeof second image as bytes
    byte[] image2data=new byte[secondsize]; //image2 buffer
    fromServer.readFully(image2data);  //read the second image as byte array

  • 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

  • Use of Cl_ABAP_ZIP Class to download multiple pdf file as a zip folder.

    Hi All,
    My requirement is like based on the user input multiple number of Invoices will be created as a pdf file and then a zip folder  will be downloaded which contain all those pdf files. I have developed a code for this requirement. When I am trying to unpack the zip folder I'm getting error that the folder is corrupted.
    If anybody have gone  through such a requirement, then kindly put some light.
    Thanks in advance.
    Regards,
    Sarbajit.

    Hi Sarbajit,
    please have a look at the below thread and check whether it will help.  it has part of code for unzipping the file.
    [http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d]

  • 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.

  • 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.

  • Problem combining multiple mp4 files in quicktime

    I'm trying to combine three mp4 files (about 70 MB each) into one video file. I read that quicktime could do this rather easily. Sure enough, after opening one mp4 I can simply drag in the other two after it.
    Next I can either close the file, which will prompt me to save the new video, or I can export the video. Either way, the initial time estimate is 2 minutes... then 4 minutes, 6, 9, etc. This goes on indefinitely and the increment of time added increases as well. The first time I tried to combine the three mp4 files I left QuickTime to save the video and when I checked back it had an estimate of over 200,000 hours left and was increasing at 16,000 hours every couple seconds.
    Seems like this is a bug of some kind but I don't have a clue how to trouble shoot this. Any ideas?
    Thanks,
    Brandon

    I still don't know what's wrong with QuickTime, but this program combined the mp4 files quick and easy:
    http://www.mp4joiner.org/en/

  • Problem opening multiple .tdms files in subroutine

    Heya-
    I'm using LabVIEW 8.2, professional development system.
    I'm using the Open / Read / Close TDMS functions as part of a subroutine in a larger program.  The subroutine is supposed to open one of several TDMS files (each of which contains bulk data saved previously), extract the data, then restructure into a 3D array, which is passed back to the main program.  The particular file TDMS file to open is controlled by the main program.  The TDMS Close function is used after the data is extracted.
    When running solo, the subVI performs as expected.  When running as a subVI, it functions fine on the first call, but subsequent calls to open different data sets fail to actually open the TDMS file (or at least, the Read TDMS function generates an empty array).  However, returning to the orginal file that was opened, the subVI works fine - it opens the TDMS file.  It doesn't matter which file was intially used - whichever one was opened first functions fine, any others do not.  That would make me think that the first TDMS file isn't being closed, except that I am using the Close TDMS function after reading.
    Attached are the subVI (TDMS_to_3D_array), a quick test program that uses the subVI, and a .zip of two data sets
    Not sure if the global variables located in the SubVI will default, so they are: UpperMaxCol: 55, UpperMinCo: 0, UpperMaxPixel: 48, UpperMinPixel: 6
    Thanks in advance for the help
    Dan
    Attachments:
    Data.zip ‏1060 KB
    TDMS_to_3D_array.vi ‏54 KB
    TDMS_loadfault_tester.vi ‏39 KB

    Hi Dan,
    Perhaps you would try a few things.
    Use the TDMS Flush VI in the subVI before the TDMS Close VI.
    Try running the program with the subVI open.
    Wire the TDMS File refnum from the subVI back to the parent and observe its value as the program switches between TDMS files.
    Perform the TDMS read in the parent VI, wire the TDMS Data and the Array Size of the TDMS dataset to the subVI.  Does this make any difference?
    Try the subVI without the Channel Name string indicator.
    Include error cluster wires throughout the entire subVI.  Wire them through the TDMS VIs, then through the nested For structures, and then back to the parent VI.
    Let us know what happens.

  • MULTIPLE UPLOAD file problem

    Hello,
    I have a problem with multiple upload file tool.
    Because my server need, in order to upload files in its folders, to be logged only with ftp user (that is unique).
    Now, I need that when I upload a file its name will be stored on db table "file_name". But in order to put data in database i have tobe logged also with user that is allowed to access on mysql db.
    So I understand that I should nedd to types of authentication at the same time...
    I think it depends on my type of hosting that is windows, and there is not the possibility to change CHMOD, so the error when I try to upload a file is that the folder has not write permissions...
    Any suggestions?
    Thanks a lot
    ascaro231
    Italy

    Hi ascaro231,
    wow, that is one bag of problems on the remote side :-(
    to be logged only with ftp user
    although PHP itself provides native FTP functions
    (e.g. for uploading files and also changing folder & file permissions), ADDT´s file upload features don´t support this protocol
    and there is not the possibility to change CHMOD
    CHMOD *will* have to be supported by your host, because this is how ADDT changes folder & file permissions.
    Well, to me it seems that your host doesn´t provide some very basic and truly common-standard PHP settings -- and honestly, disabling the regular PHP file upload features is ridiculous.
    Any suggestions?
    go for a better host -- this is just inacceptable.
    Are you hosting with "Aruba" BTW ? They have both Windows and Linux hostings, and AFAIK it´s possible to switch the hosting type.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • 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.)

Maybe you are looking for