Unable to upload multiple files on FTP server.

m trying to upload files present in one directory..
its storing the first file properly...but from second file its giving error.
my code is pasted below:
ftp1.setFileType(FTPClient.BINARY_FILE_TYPE);
ftp2.setFileType(FTPClient.BINARY_FILE_TYPE);
             String filename="";
            FTPFile[] files = ftp1.listFiles();
            if ( files.length == 0 )
                System.out.println("  No results.");
            } else
                 for (int i = 0; i < files.length; i++)
                      FTPFile f = files;
          filename = f.getName();      
          System.out.println(" > " + filename );
          ftp2.enterRemotePassiveMode();
     ftp1.enterRemoteActiveMode(InetAddress.getByName(ftp2.getPassiveHost()),
          if (ftp1.remoteRetrieve(filename) && ftp2.remoteStore(filename))
               System.out.println("Successfull >" + filename);
          else
               System.err.println(
               "Couldn't initiate transfer. Check that filenames are valid.");
               break __main;
     }//end of for
     ftp1.completePendingCommand();
     ftp2.completePendingCommand();
}// end of else
my code is actually trying to list files from FTP Server1 and copy this to FTP Server2.
I think the problem is
ftp2.enterRemotePassiveMode();
     ftp1.enterRemoteActiveMode(InetAddress.getByName(ftp2.getPassiveHost()),
please can any one figure out the problem...
any help suggestion is welcome....

What about connecting to the remote server with cfftp. Then
using
cfdirectory to get a listing of the files. Loop over the
listing using cfftp
to grab each file.
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technology, Inc.
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) ::
http://www.adobe.com/communities/experts/
"Dusty Carr" <[email protected]> wrote in message
news:f59tue$731$[email protected]..
>I need to get files from a remote server using cfftp, the
problem is that
> the files are not zipped into one file, there are
multiple files with
> different file names that change daily, all are .jpg
extensions. I
> thought
> I could just use something like this:
> <cfftp action = "getFile"
> stopOnError = "Yes"
> remotefile = "/*.jpg"
> localfile = " my dir"
> connection = "ftp_IDX"
> failIfExists = "false"
> passive="yes">
>
> But just using the * wildcard does not work. what am I
missing here?
>
>

Similar Messages

  • Unable to upload multiple files

    In MOSS, I am unable to upload multiple files from the Site Actions | Manage Content and Structure | New | Item menu. I have tried adding Word documents and image files (JPEG, GIFS) to no avail into the \images or \document folders. Even if I try just one file, three or five, the menu never initiates or progresses. It just sits. If I cancel, the menu returns immediately. I have tried to change security settings with no success. Trying to upload multiple files on different MOSS installations also fails. If this is related to a Web Dev settings, can you tell me exactly where the setting is? Thanks for your insight. cm

    Believe it or not, I have found a solution after about 4hrs of fiddling around. This appears to be a bug in Sharepoint 2007. There is a work around that I have discovered! Follow the steps below and let me know if this works for you. It has worked for me and other people so far.
    The steps are as follows:
    1) Browse to your website at http://<servername>/_layouts/settings.aspx; you will need to login by providing a service account name & password or your site collection administrator account & password.
    2) Once you login, click on 'Site Actions' menu.
    3) Then, click on 'Manage Site Content and Structure'.
    4) Click on any document library you want to upload or add files into. If you do not see the 'Upload' menu from the dropdown main menu between the 'New' and 'Actions' menu then you have this bug as well showing up on your server. Don't give up yet, there is a solution. Keep going through these steps!
    5) Click on 'New' and select 'Item'.
    6) You should now see the Upload Document page; under the input browse field there should be a link for 'Upload Multiple Files...', if you do not see this you will need to install either Office 2003 or Office 2007. If you do see it, click on it.
    7) Now, you should see the multiple upload page that allows you to select multiple files. If you try to select one or several and click on the OK button, nothing will happen. No need to worry! There is a work around. Just keep reading to the next step.
    8) On the hierarchy navigation you will have links something like this:
    WebSiteName > Folder1 > Folder2
    9) Click on the "Document Library" folder name; in our case it was Folder1. Basically its the folder you ended up in in step #4.
    10) Now, did you notice anyting in your menu change? Now you should be able to see the Upload menu option between the 'New' and 'Actions' menu that you could not see in step #4.
    11) Click on the 'Upload' menu and select 'Upload Multiple Documents'
    12) Now, you will be back at the Upload document page where you were in step #7
    13) Select one file or many and then click OK. Now it works!!! You should get an IE popup asking you that your about to upload files to your site, Click OK.
    VOILA!!!
    Don't ask me why, I do not know why this happens but it works.

  • Upload XL file from FTP server

    Hi All,
    Can anybady help me, how to upload Excel file from FTP server.
    Thanks
    Sri
    Edited by: srikanthn on Apr 14, 2010 6:31 PM

    Hello
    How about using SAPFTP?
    I hope SAP note 130106 will guide you on this.
    Thanks
    koju

  • How to upload multiple files into a server location at a single time

    Hi All,
    In my application i need to send multiple files from a particular page into the server location. In this page there will be an option to upload a file and after selecting the file , we will have an option asking if we were interested to send another file. It works just similar to google mail where we can multiple files at the same time. Right now though i had coded the uploading files concept i am facing some problems when trying to upload multiple files. All the files are being appended to a single file but i want them to be placed as different files at the specified location. Plz help me in this regard...
    Thanks in advance................,,

    Hi,
    i am sending the code in my prg. Have a look at it.
    var multi_selector = new MultiSelector( document.getElementById( 'files_list' ),3);
    In the above line i am specyfying that the maximum no. of files to be uploaded is 3. So if i upload less than 3 files, the program doesn't work and is not reading the uploaded files. If i upload 3 files it works fine. So please suggest me how to make this work irrespective of the no. of files uploaded using apache commons.
    My code is as follows:
    <form action="./servlet/Sample" method = "post" enctype="multipart/form-data">
         <!-- The file element -- NOTE: it has an ID -->
         <input id="my_file_element" type="file" name="file_1" >
         <input type="submit" name="submit1" value="submit">
    </form>
    Files:
    <!-- This is where the output will appear -->
    <div id="files_list"></div>
    <script>
         <!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->
         var multi_selector = new MultiSelector( document.getElementById( 'files_list' ),3);
         <!-- Pass in the file element -->
         multi_selector.addElement( document.getElementById( 'my_file_element' ) );
    </script>

  • Unable to poll for files in FTP server using Proxy Service (in OSB Project)

    Here are the stepd followed for creating proxy service that should poll ftp server to retrieve files but polling is not happening and unable to see any errors in logs.
    1. Created service account by selecting resource type as static and providing the ftp user and password details.
    2. Created a New Proxy Service in eclipse
         Tab General - service type as Messaging Service
         Tab Messaging - Request Message Type as Text, Response message type as None
         Tab Transport - Protocol selected as "ftp"
              - Endpoint uri entered in the format - ftp://hostname:port/directory
    FTP Transport -Selected "external user" as User Authentication
              - Selected the Service Account thats created in step1/
                   - File mMask - *.*
                   - Polling Interval 60
                   - Read Limit 10
                   - Post Read Action - Delete
                   - Transfer mode - binary
                   - Download Directory - "some local directoy"
                   - Error Directory - "some local error directory"
    Could any one please help here to trouble shoot the polling issue and correct me if this is wrong approach.
    Thanks

    Did you configure the FTP adapter which is present in Weblogic server?I think he's using FTP transport in OSB and not the JCA adapter, if that's the case FtpAdapter configuration wouldn't help...
    unable to see any errors in logsThat's odd, try to mess up the hostname and see if you get a connection refused on the logs...
    It may be a permissions issue, the user you're connecting may not even "see" the files you place there... Try using the same user to create and to poll files...
    Cheers,
    Vlad

  • Unable to upload DW files with FTP or Fetch

    I cannot preview with Firefox all DW files which
    before could be previewed. The new files created could not be
    upload using FTP of Fetch.
    FTP says "file connection incomplete file not complete; put
    operation failed "file.htm does not exist in local site"
    Fetch says "could not put 'file.htm' because FTP server
    encountered an error accessing file; server
    responded:file.htm:access denied" what may have gone wrong?

    Your FTP information must be wrong.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "t2t0" <[email protected]> wrote in message
    news:gn5me4$a3u$[email protected]..
    >
    I cannot preview with Firefox all DW files which
    before could be
    > previewed. The new files created could not be upload
    using FTP of Fetch.
    > FTP says "file connection incomplete file not complete;
    put operation
    > failed
    > "file.htm does not exist in local site"
    > Fetch says "could not put 'file.htm' because FTP server
    encountered an
    > error
    > accessing file; server responded:file.htm:access denied"
    what may have
    > gone
    > wrong?
    >

  • [HELP] Download file from FTP server

    hi,
    I want to write a java program that can download and upload files from ftp server. Currently I only manage to upload a file to ftp server but i cant download file from ftp server. Here is the source code that only allow user to upload file. Anyone can give me some guidelines so that my program can download and also upload file? thx.
    import java.io.*;
    import java.net.*;
    public class FTPUpload {
    private static final int CTRLPORT = 21;
    private static Socket ctrlSocket;
    private static PrintWriter ctrlOutput;
    private static BufferedReader ctrlInput;
    private static byte[] localHostAddress;
    public final static String DIR = "C:\\zip\\";
    public static void main(String[] args) {
    try {
    String host = "192.168.1.1";
    String loginName = "testuser";
    String password = "password";
    String dirName = "/home/testuser";
    String fileName = "hello.zip";
    ctrlSocket = new Socket(host, CTRLPORT);
    localHostAddress = ctrlSocket.getLocalAddress().getAddress();
    ctrlOutput = new PrintWriter(ctrlSocket.getOutputStream());
    ctrlInput = new BufferedReader(new InputStreamReader(ctrlSocket.getInputStream()));
    ctrlOutput.println("USER " + loginName);
    ctrlOutput.flush();
    ctrlOutput.println("PASS " + password);
    ctrlOutput.flush();
    ctrlOutput.println("CWD " + dirName);
    ctrlOutput.flush();
    ctrlOutput.println("TYPE I");
    ctrlOutput.flush();
    FileInputStream fis = new FileInputStream(DIR + fileName);
    Socket dataSocket = dataConnection("STOR " + fileName);
    OutputStream outstr = dataSocket.getOutputStream();
    int n;
    byte[] buff = new byte[1024];
    while ((n = fis.read(buff)) > 0) {
    outstr.write(buff,0,n);
    dataSocket.close();
    fis.close();
    ctrlOutput.close();
    ctrlInput.close();
    ctrlSocket.close();
    }catch (Exception e) {
    e.printStackTrace();
    private static Socket dataConnection(String ctrlcmd)
    throws IOException,UnknownHostException {
    String cmd = "PORT ";
    ServerSocket serverDataSocket = new ServerSocket(0,1);
    for (int i=0;i<4;i++) {
    cmd = cmd + (localHostAddress[i] & 0xff) + ",";
    cmd = cmd + (((serverDataSocket.getLocalPort())/256) & 0xff)
    + ","
    + (serverDataSocket.getLocalPort() & 0xff);
    ctrlOutput.println(cmd);
    ctrlOutput.flush();
    ctrlOutput.println(ctrlcmd);
    ctrlOutput.flush();
    Socket dataSocket = serverDataSocket.accept();
    serverDataSocket.close();
    return dataSocket;
    }

    Or just use a java.net.URL("ftp://...) ..., get its input stream, and away you go ...

  • Is it possible to upload large files through FTP to server with iWeb?

    Is it possible to upload large files through FTP to server with iWeb like for example with Cyberduck?
    I don't need to publish website with files, I just need to upload files on server. Can it be done somehow with iWeb?

    Here's some info about FTP...
    http://www.iwebformusicians.com/Search-Engine-Optimization/Upload.html
    Make sure you are allowed to store files on your server. Most hosting services don't allow anything to be stored that can't be accessed via the internet. Check the fine print!

  • Upload files from FTP server

    Hi Friends,
    We are loading some files from FTP server into the BW (Datasource)
    In the infopackage we have given the setting as 'Load from application server' and have given the file path as it is in application server. No routine has been created.
    Files are successfully loading from FTP server to the BW datasource.
    My question is:
    In the infopackage we have only maintained that it should be loaded from application server and the file path.
    But how the system(infopackage) gets to know that  from which server(FTP) it should pick. Is there any table to maintain these entries. i.e when infopackage is scheduled it only pings the required server and picks the file with the help of given file path.But how does it know which server it should ping.
    Pls help.
    Thanks & Regards,
    Niku

    Hello Niku,
    It seems in your case you have only one FTP, and the system is pointing by default to that FTP and picking the required files fro your Info Package.
    Normally a Standard ABAP Program  RSFTP002 is used to communicate to the FTP Server with the help of RFC . In the Same program you can maintain the credentials ( USerName and password) along with the Source and Destination related properties .
    Back to your query , you can check the same in above program ( RSFTP002 ) through SE38 and cross verify your FTP .
    Hope this helps !
    Regards
    YN

  • Files from FTP server to Application server

    Hi All,
    I am new to SDN and SAP XI, can anyone tell me whether its possible to move the files (different strcuture files i.e. some are master data files and some are transaction data file) from FTP server to Application server with one interface. Actually the process is already established at clientsite for placing master data files like product, plant etc from FTP server to App server through FTP adapter. Now my requirement is to move transaction data file with completely different structure as master data to App server. If we place these trasaction data file in same folder/directory as master data files does SAP XI pick this file also. If not what are the steps I need to follow to achieve this. I know that if we create new configuration it will work but I question is does master data interface picks this transaction data file also.
    Right now our process for master data files is SAP XI picks the files and deletes the file from FTP server folder. The master data file names are plant_attr.csv, product_attr.csv etc and transcation data file name is salestrasactiondata.csv. I need to move these files to application server on daily bases.
    I appreciate your help .
    Regards
    Bob.

    > I am new to SDN and SAP XI, can anyone tell me whether its possible to move the files (different strcuture files i.e. some are master data files and some are transaction data file) from FTP server to Application server with one interface.
    Hello Bob,
    Yes it is possible.
    There can be two ways of doing it.
    1. N:1 mapping, BPM will require for this.
    N:1 Mapping refer this blog
    IDOCs (Multiple Types) Collection in BPM
    BpmPatterns CollectMerge
    part1  BPM with Patterns explained Part-1
    part2  BPM with Patterns explained Part-2
    Second option
    Create 3 scanarios in integration directory and correspondingly in integration repositoy create different data types, message types, mappings & interface mappings and then in each of scenario us different message interface and interface mapping.
    > I know that if we create new configuration it will work but I question is does master data interface picks this transaction data file also.
    >
    If you are using N:1 scenario then use *.csv in your sender adapter under file name parameter and then all the files will be picked up from same directory.
    If you are using second option (3 different scenarios) then also you can pick the different files from same directory. You will be having 3 sender adapters in this case, So, one for picking master data, and another for product data and the last one for transaction data.
    So, in case of master data use "plant_*.csv" as a file name and directory name.
    In case of product data, use "product_*.csv " as a file name and source directory will remain same.
    similarly do it for transaction data.
    So by this way all 3 sender adapters will perform their job to pick the different files from same source directory.
    Regards,
    Sarvesh

  • How do you upload multiple files?

    Hi,
    This is propably an easy one.
    I am trying to upload multiple .gif files to a folder in KM.
    I went to Content Management -> KM Content and created a new folder inside a sub-folder.
    Now when I click on the contect menu I select New.. and then Upload...
    However, this only allows me to select for upload one file at a time.
    I neeed to upload about 50 files. It will take ages doing this one by one!
    Is there a quicker way?

    Hi
    Multiple upload of files is possible by using WEBDAV protocol.To use this follow the below steps.
    Go to folder to which u want to upload the files and the click on the context menu and select details.A new window will open up.In that select settings->properties->accesslinks.copy the WEBDAV link shown there.
    Now
    click My Network Places on your desktop, and choose Tools from the top menu bar/Map Network Drive from the context menu. If you donu2019t find My Network Places on your desktop you can find it under Windows Start menu option on your computer.
    select Sign up for online storage or connect to a network server. Click next
    Highlight Choose another network locations. Click next
    Use Cntrl+V to paste the URL path name(webdav URL).  Click next
    Change the URL location to the name of the folder in KM. Hit next.  Hit finish
    A folder by the name you just created will appear under my network places on your explorer application.
    Using this u can upload multiple files directly into folder u want.
    Hope this solves ur problem.
    Regards
    Hussain.

  • Uploading Multiple files in One-Click!!!

    Hi All,
    I have got nearly about 900 PDF files in my file server which need to be uploaded to the KM CONTENT Repository.
    what is the best methodology to upload all these file in to the repository in <u><b>one click.</b></u>
    Is it possible to achieve this??
    Eagerly waiting for replies.
    Regards,
    Kavitha

    Hi Patric,
    It is quite interesting to see that there is a way to upload multiple files in a click.
    I just followed your way. i copied the WebDAV URL and pasted and executed in a new browser. and i get....
    <i>The folder you are looking for has no displayable content.
    You can try one of the following:
    Access the folder using the Navigation user interface.
    Access the folder as a Web folder. Your operating system and browser dictate whether or not this will work.</i> "
    When i choose "Web Folder", i get a pop up and it says "<i>The web folder address Internet Explorer was given was too long. Please use a shorter address</i>."
    When i choose "Navigation User Interface", iam taken to the default KM Folder.
    I nowhere able to see the folder structure like what you have mentioned in your reply.
    Kindly help me out.
    Regards,
    Kavitha

  • Connection refused Error while writing file to FTP server.

    Hi All,
    We got below error while writing file to FTP server. Any one have any idea on this?
    sABCS_1.0_8e88588d4fb54ebd2ac7ef66c8421d52.tmp/writeEncryptedFile.wsdl [ Put_ptt::Put(opaque) ] - Could not invoke operation 'Put' against the 'FTP Adapter' due to:
    ORABPEL-11429
    Error sending file to FTP Server.
    Unable to send file to server. [Caused by: Connection refused]
    Please ensure 1. Specified remote output Dir has write permission 2. Output filename has not exceeded the max chararters allowed by the OS and 3. Remote File System has enough space.

    Hmmm ...
    Same issue as your post from three months' earlier?
    Re: Error while putting file in sftp location.

  • How to upload multiple files using af:inputfile

    Hi,
    I am using J dev 11.1.1.3. I have a requirement wherein i need to upload multiple files using af:inputfile. Can we do in it ADF ? Is there any other work around to implement the same. I have checked previous questions but not able to find proper solution for this.
    Any pointer in this regard is highly helpful.
    Regards,
    Kalyan

    You have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
    1) allow the user to select multiple filenames (somehow)
    2) zip them together
    3) upload the zip
    4) unpack the zip on the server
    5) work with the files
    Timo

  • How to upload multiple files using wicket

    Hai,
    how to upload multiple files using wicket at a single browse.
    any suggestion?
    Thanks in advance

    You have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
    1) allow the user to select multiple filenames (somehow)
    2) zip them together
    3) upload the zip
    4) unpack the zip on the server
    5) work with the files
    Timo

Maybe you are looking for