Unable to send file in binary mode to ftp server using AIR application

Hi,  Can any one help me. i am trying to send local files to ftp server  in binary mode from AIR application using sockets.
I cant use PASV mode for this FTP server because security restrictions. when i am trying to send Binary command i am always getting
error code 500 which is unrecognized command. I googled for solutions but i cant find any one using Binary mode to send data every example is using PASV mode to send
file.
code example:
private function upload():void{
sendCommand("binary ");
private function sendCommand(arg:String):void {
                                        arg +="\n";
                                        s.writeUTFBytes(arg);
                                        s.flush();
in response i am getting unrecognized command.

I'm successfully using an ftp example from http://http://projects.maliboo.pl/FlexFTP/
that I converted to spark and uses a popup progress window.
If you don't need to use sockets I can post a sample project.
I believe I still connect with PASV, but have no problems sending Binary files.
I don't think they're commands that are dependent on each other

Similar Messages

  • I am unable to send to an address that I have been using for a long time. All aspects have been investigated but with no solution ,has anyone encountered this problem before?

    I am unable to send to an address that I have been using for a long time. All aspects have been investigated but with no solution ,has anyone encountered this problem before?

    Hi Eric,
    The message seems to totally disappear. It is going to an AOL customer in UK. I changed their address to start with a lowercase letter & the message was returned to me by AOL as undeliverable, I then changed the first letter of the address beck to upper case, the same I have been using for years, but again it disappeared.
    I appreciate any help you can give me. Tks Gord.

  • How can I send files from my macbook pro to my iPad air using airdrop

    how can I send files from my macbook pro to my iPad air using airdrop?

    Your going to have to find some alternative.  See Dukto will work.
    "Dukto is a simple application that allows you to share files between devices connected to the same (wireless) LAN network."
    http://www.tidal.it/?page_id=309&lang=en
    http://www.msec.it/blog/?page_id=11
    "Box lets you store all of your content online, so you can access, manage and share it from anywhere. Integrate Box with Google Apps and Salesforce and access Box on mobile devices" Rated the most secure cloud storage by SkyHigh Networks.  You can buy a license to run box one of your servers.
    https://www.box.com/
    Files Connect -- "Cloud Storage services like Dropbox, MobileMe iDisk, Google Docs/Picasa, Facebook photos, FTP, SFTP, WebDAV ... AFS (Apple File Shares) SMB (Windows shares)  protocols"
    https://itunes.apple.com/us/app/files-connect/id404324302?mt=8
    "The kiteworks mobile file sharing solution provides secure creation, viewing, and sharing of enterprise content on smartphones and tablets while providing IT and security teams the administrative controls to manage user privileges and access rights necessary to ensure enterprise security and compliance."  " Includes choice of private cloud on-premise."
    http://www.accellion.com/solutions/mobile-enablement/mobile-file-sharing

  • How do I send files from iMini to a PC laptop using Bluetooth?

    How do I send files from iMini to a PC laptop using Bluetooth?

    you don't.  iOS only supports bluetooth headsets, speakers and input devices.

  • Process TIFF file from FTP server using File/FTP adapter

    Hi,
    I have a requirement to process a scanned document TIFF file from a directory on an FTP server using the File/FTP adapter and process through XI into a Web Service via a receiver SOAP adapter.
    My question is can the file/FTP adapter be used to process the TIFF file into XI from an FTP server ? Also, what settings need to be made on the file adapter to allow this file to be processed into XI ?
    Thanks in advance
    Colin

    hi colin,
    TIFF is type of image file, it can be converted to binary using java mapping
    refer this pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    regards
    Ramesh P

  • Copy file from FTP server to sap application server

    Hi,
    I am able to copy a particular file from FTP server to sap application server using FTP_CONNECT, FTP_COMMAND and FTP_DISCONNECT. But here my problem is, it copies into default application server path(DIR_HIOME). I want to copy into specified folder in the application server. How can I specify the required destination path.
    Can you please suggest how to achieve this.
    Thanks,
    Shiva Kankanala

    try something like this:
    data: user(30) type c value 'ftpuser', "ftp username
                  pwd(30) type c value 'ftppass', "ftp password
                  host(64) type c value '255.255.255.255', "ftp server IP
                  cmd1(80) type c value 'lcd /dump', "location on app server where you want to copy the file
                  cmd2(80) type c value 'get', "specifies you are going to get the file from ftp server
                  dest like rfcdes-rfcdest value 'SAPFTPA',
                  file(15) type c value 'file.txt'. "specifies file that you want to get from ftp server
    data: hdl type i,
            key type i value 26101957,
            slen type i.
    slen = strlen( pwd ).
    call function 'HTTP_SCRAMBLE'
        EXPORTING
          source      = pwd
          sourcelen   = slen
          key         = key
        IMPORTING
          destination = pwd.
    call function 'FTP_CONNECT'
        EXPORTING
          user            = user
          password        = pwd
          host            = host
          rfc_destination = dest
        IMPORTING
          handle          = hdl.
    call function 'FTP_COMMAND'
        EXPORTING
          handle        = hdl
          command       = cmd1
        TABLES
          data          = result
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      loop at result.
        write at / result-line.
      endloop.
    CONCATENATE cmd2 file INTO cmd2 SEPARATED BY SPACE.
    call function 'FTP_COMMAND'
          EXPORTING
            handle        = hdl
            command       = cmd2
          TABLES
            data          = result
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        loop at result.
          write at / result-line.
        endloop.
        refresh result.

  • How to connect to a FTP server using a proxy in a DMZ with XI file adapter?

    Hello,
    Want to connect to an ftp server using a proxy in the DMZ. I don't see any standard options in the XI file adapter to use a standard. Is there a workaround?
    I already looked at https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=57137
    But it didn't help me.
    Regards,
    Erik van Lisdonk

    U can't use FTP over SSH i.e., SFTP. But u may use FTPS by enabling the SSL layer on J2EE of XI. See this
    SFTP vs. FTPS in SAP PI
    Regards,
    Prateek

  • Unable to connect to the remote ftp server using dreamweaver.

    For the last one week I have been trying to connect to the remote ftp server using dreamweaver. I spoke to the technical support agency who manage our remote server but they are saying that there is no problem with the server adn they dont know anythign about dreamweaver so cant assist me.
    I was suggested to check with adobe team directly and i spoke to a technical support person on the live chat but they said since the version is CS4 - education version, they cant assist me at all!! This is just ridiculous...I am constantly being sent from one place to the other without anything getting resolved!!
    Please help somebody!!

    I am having a similar problem... maybe.  I was connected to my remote site all day yesterday, then out of the blue I tried to "put" an edited file... as I had been doing all day, and I received an FTP error:  Cannot make connection to host. Your login or password is incorrect.  That's odd, I've been connecting all day.  So I went into my sites > manage sites and clicked the Test button on my remote server information and it returned Adboe Dreamweaver CS connected to your webserver successfully.  I went back to my file and tried once more to "put" it on the remote server... again FTP Error: cannot make connect to host...  So I reboot my computer and start Dreamweaver CS3 again.  I reenter my remoter server information and click the Test button.  "... connect to your webserver successfully".  I try to put any file, FTP error again.  So I call my server administrator, he checks the servers logs and says there are no errors and you've connected successfully several times today.  I went through the trouble shooting steps listed here, though my FTP Logs are empty.  I cannot stay connected or even see the remote folders to try to drag and drop.  I tried to run ftp from a windows command prompt and it seems to connect me.
    I downloaded an installed an SFTP client and was able to successfully connect to my remote server and upload the files.  It's definately a Dreamweaver problem.  Any suggestions?

  • Unable to send file to FTP server

    Hi All,
             I am using a File to File scenario. In that i am using FTP. The file is not reaching the target side. It is displaying the following error. I have checked the Target directory, it is  correct.I am able to send manually FTP File to the same target directory.
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: An error occurred while connecting to the FTP server 'acmxrtdb:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 C:\BankFiles\FromSAP\Wells: The filename, directory name, or volume label syntax is incorrect. '. For details, contact your FTP server vendor..
             Please help me in solving this. It would be very helpful to me.
    Thanks & Regards,,
    Raju.D

    Hi,
    the path specified is not correct.
    The value "0 C:\BankFiles\FromSAP\Wells" is not valid if the protocol is FTP. This is the physical directory on the operating system.
    If you're using an FTP server you need to know the path to the file on the FTP.
    To do this I suggest to connect to the FTP using Internet Explorer and navigating the FTP folders until reaching the right one.
    Then on the url bar you should got something like this: "ftp://server:21/path/to/file/". Use "/path/to/file" as value for the file adapter configuration.
    Hope this help
    Francesco

  • 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

  • Cannot send files from phone to Satellite L755-16z using BT

    Hi, experts :)
    I'm gonna get straight to the point !
    I've got a toshiba satallite L755-16z since a month or so (New, with windows 7 64-bit)
    and its is known that it has BT and I guess its 3.0
    So I tried to connect the bluetooth with my phone & it paired just fine !
    but when I try to send files from and to my phone, it says (connecting) but doesn't manage to send it in the end. furthermore, this problem isn't only with my phone as I've tried sending and recieving to & from another phone, but still same problem !
    HOWEVER, I tried to turn the BT adapter off (right click on bluetooth Icon in notification area then turn adapter off), then starting the (bluetooth monitor) application, and sending files & IT WORKS !!
    But this happens only for one time right after restarting bluetooth, so everytime I have to send files, I have to turn BT off then turn it on ?!!!
    This is kind of Unacceptable !
    I tried Toshiba Bluetooth Stack, and it had the same problem. Also, I didn't like the way it worked (style and everything) ... so I uninstalled it & returned to the original BT version in pc.
    I've searched for answers with no luck & now I'm desperate for the answer !
    Plz anyone who knows how to solve this issue, help me Plz ??!
    If my email is needed : [[email protected]]

    ok I tried to turn it off with fn + f8 ... wlan turns off with it too, that's natural, I know :)
    then I turned it on & I recieved a file from phone just fine ... that only worked ONE time !
    after that, sending/recieving files won't work ... on my phone it says ( cannot connect ) .... same thing when I restart bt monitor manually !!
    Also, I have tried going to ( C:\Program Files (x86)\TOSHIBA\Bluetooth Monitor ) folder
    there are other bt monitors like (btmon2) and (btmon64) but both of them are have same problem but has more time of activity !
    the problem itself isn't that its on or off ...
    it is on and it appears in the notification area ... but only works for only a short period of time ...
    or for (btmon2) I can say it works right after starting it ... then works for a while when its active (sending files or recieving files) ... but after a while with no activity (no sending/recieving) It Stops Working :(
    How can I fix the problem ???
    Mr. Tonny ? Anyone ??

  • Is anyone having problems sending files from SendNow now that they've used Send?

    I sent a couple files in Send and now I cannot send files in SendNow.  It tells me to check my internet connection and that it cannot send the files.  I've reset the internet connection and it still does not work.  I even tried send a file through Send and it worked fine, but when I went back into SendNow I got the same message. Are other people having issues with this? Any suggestions?

    It is very strange because I've always used Google Chrome to use SendNow
    and I've never had a problem until this morning after trying Send.  I went
    it and tried it in Firefox and it worked fine, but still doesn't in Chrome.
    Not sure what happened because I used Send in Chrome and it worked fine.
    Thank You,
    Roxanne Schutz
    Gatehouse Media, Inc. NE Holdings, Inc.
    Heartland Classifieds- Maverick Media, Inc.
    Penny Press 1, Penny Press 4, News-Press,
    Syracuse Journal-Democrat, Hamburg Reporter
    P.O. Box "O"
    Syracuse, NE  68446
    1-877-269-3358
    [email protected] <[email protected]>
    This message may contain confidential and/or privileged information.  If
    you are not the intended recipient or authorized to receive this for the
    intended recipient, you must not use, copy, disclose or take any action
    based on this message or any information herein.  If you have received this
    message in error, please advise the sender immediately by sending a reply
    e-mail and delete this message.  Thank you for your cooperation.

  • I have a problem sending files along with thier directories to server

    The Problem is i couldnt understand the sequence in which should the file transfers will execute.....
    Here is the Code ......
    The **************Error************* i get is that it makes one dir then other one and paste one file in it after writing another file in the second loop it gives error on write UTF that Socket write Error COnnection Reset by peer
    ***************************CLIENT************************
    package oam.filemanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    import oam.beans.*;
    public class FileClient {
    Socket socket;
    DataOutputStream dataout;
    FileBean file;
    public void SetSocket() {
    //Create socket connection
    try {
    socket = new Socket("localhost", 9898);
    dataout = new DataOutputStream(socket.getOutputStream());
    String wavfiles []=null;
    //Directory & Wavfiles Manipulation
    file=new FileBean();
    String dirs []= file.getDirsForSocket("Accounts//");
    for(int i=0;i<dirs.length;i++){
    wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
    //sending Username & DIR
    dataout.writeUTF(dirs);
    if (wavfiles.length==0)
    dataout.writeUTF("no");
    for (int j=0;j<wavfiles.length;j++){       
    //Sending Filename
    dataout.writeUTF(wavfiles[j]);
    //getting file to be send
    File f = new File("Accounts//"+dirs[i]+"//"+wavfiles[j]);
    int fileLength = (int) f.length();
    System.out.println("fileLength " + fileLength);
    byte data[] = new byte[fileLength]; //settting array of byte to file len
    //reading from file acha
    FileInputStream fis = new FileInputStream(f);
    // Send file length
    dataout.writeInt(fileLength); // writing file length
    dataout.flush();
    System.out.println("Length Sent .... " + fileLength);
    dataout.flush();
    // Send file
    int loop = 0;
    loop = fis.read(data);
    System.out.println("......1......" + "in loop" + loop);
    if (loop > -1) {
    dataout.write(data);
    //closeConnection();
    // output.flush();
    catch (UnknownHostException e) {
    System.out.println("Unknown host:");
    System.exit(1);
    catch (IOException e) {
    System.out.println("No I/O " + e.getMessage());
    System.exit(1);
    catch (Exception e){
    e.printStackTrace();
    public static void main(String args[]) {
    FileClient serv = new FileClient();
    serv.SetSocket();
    ******************************************SERVER*********************
    import java.io.*;
    import java.net.*;
    import java.io.*;
    class ClientThread
    implements Runnable {
    FileOutputStream output;
    DataInputStream input;
    String uname;
    String filename;
    Socket client;
    public ClientThread(Socket clientth) {
    this.client=clientth;
    public void checkdir(String dirname){
    File f =new File("..//Accounts//"+uname+"//");
    if (!f.exists()){
    f.mkdirs();
    public void run() {
    try {
    while (true) {
    input = new DataInputStream(client.getInputStream());
    uname = "";
    filename = "";
    uname = input.readUTF();
    checkdir(uname);
    filename = input.readUTF();
    if (!filename.equals("no")) {
    System.out.println("Filename Recieved of file: " + filename);
    File f = new File("..//Accounts//" + uname + "//" + filename);
    if (!f.exists()) {
    RandomAccessFile raf = new RandomAccessFile(f, "rw");
    raf.setLength(0);
    int length;
    int pack = 0;
    int fileLength = 0;
    System.out.println("User Name received...." + uname);
    System.out.println("...2a....");
    fileLength = input.readInt();
    System.out.println("...2b....");
    System.out.println("Length Receieved .... " + fileLength);
    // input.readInt();
    // input.readInt();
    byte data[] = new byte[fileLength];
    System.out.println("Length Receieved .... " + fileLength);
    input.read(data);
    raf.write(data);
    raf.close();
    System.out.println("File Receieved and Wrote at Server");
    // clientoutput.flush();
    else {
    System.err.println("File Already Exists request by " + uname);
    } //if check ends
    catch (IOException e) {
    System.out.println("in or out failed"+ e.getMessage());
    System.exit( -1); }
    public class FileServer {
    Socket client;
    ServerSocket server;
    public FileServer(){
    File f=new File("..//Accounts") ;
    if(!f.exists())
    f.mkdirs();
    public void listenSocket() {
    try {
    server = new ServerSocket(9898);
    catch (IOException e) {
    System.out.println("Could not listen on port 9898 Server Already Listening");
    System.exit( -1);
    while (true) {
    ClientThread cth;
    try {
    cth = new ClientThread(server.accept());
    Thread thr = new Thread(cth);
    thr.start();
    catch (Exception mye) {
    mye.printStackTrace();
    protected void finalize() {
    try {
    server.close();
    catch (IOException e) {
    System.out.println("Could not close socket");
    System.exit( -1);
    public static void main(String args[]) {
    FileServer serv = new FileServer();
    serv.listenSocket();

    Well Thanks a lot : jschell so nice of u helping me all through this well i sort out this problem as well...
    i wasnt sending all files at once ...........one by one the problem was the biggest file is 240 k and byte arraay couldnt accomdate it ................so now i am sending files in 4k packets any of u guys need help u can see this code how to send files in packets .................
    //**********************SERVER************************************
    package servermanager;
    import java.io.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class ClientThread
        implements Runnable {
      FileOutputStream output;
      DataInputStream input;
    DataOutputStream dataout;
      String uname;
      String filename;
      Socket client;
      JTextArea log;
      public ClientThread(Socket clientth,JTextArea mylog) {
        this.client=clientth;
        this.log=mylog;
      public void checkdir(String dirname){
      File f =new File("..//Accounts//"+uname+"//");
      if (!f.exists()){
        f.mkdirs();
      public synchronized  void  startTransfer(){
          try {
              FileOutputStream fos=null;
              input = new DataInputStream(client.getInputStream());
              uname = "";
              filename = "";
              uname = input.readUTF();
              checkdir(uname);
              filename = input.readUTF();
              File f = new File("..//Accounts//" + uname + "//" + filename);
              RandomAccessFile raf = new RandomAccessFile(f, "rw");
              raf.setLength(0);
              raf.close();
              long fileLength=0;
              byte lenbuf[]=null;
              int help =input.read();
              lenbuf = new byte[help];
              input.read(lenbuf);
              String lenz = new String(lenbuf);
              fileLength = new Integer(lenz).longValue();
              fos = new FileOutputStream (f);
              byte data[]=new byte[4096];
              int length;
              while( (length=input.read(data, 0, 4096)) > 0) {
               fos.write(data, 0, length);
              fos.close();
      log.append("\n File Recieved = ["+filename+"]:---:"+"of Size["+fileLength+"]:---:"+"By ["+uname+"]." );
        catch (IOException e) {
          log.append("\n In or Out failed"+e.getMessage());
          System.exit( -1);}
      public void run() {
        startTransfer();
    public class FileServer extends JFrame {
      int port;
      Socket client;
      ServerSocket server;
      JScrollPane textscrollpane = new JScrollPane();
      JTextArea log = new JTextArea();
      JButton clear_btn = new JButton();
      JButton stop_btn = new JButton();
      public FileServer(){
        port=9898;
        File f=new File("..//Accounts")  ;
        if(!f.exists())
         f.mkdirs();
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public void listenSocket() {
        try {
          server = new ServerSocket(port);
        catch (IOException e) {
         log.append("\n Could not listen on port["+port+"]");
         System.exit( -1);
        while (true) {
          ClientThread cth;
          try {
            cth = new ClientThread(server.accept(),log);
            Thread thr = new Thread(cth);
            thr.start();
          catch (Exception  mye) {
         log.append("\n Thread Exception["+mye.getMessage()+"]");
      protected void finalize() {
        try {
          server.close();
        catch (IOException e) {
              log.append("\n Could not Close Socket on port["+port+"]");
          System.exit( -1);
      public static void main(String args[]) {
        FileServer serv = new FileServer();
        serv.setBounds(new Rectangle(150,150,500,300));
        serv.show();
        serv.listenSocket();
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(null);
        textscrollpane.setBounds(new Rectangle(1, 21, 489, 212));
        log.setBackground(Color.black);
        log.setForeground(Color.green);
        log.setToolTipText("Server Log");
        log.setEditable(false);
        log.setLineWrap(true);
        clear_btn.setText("Clear");
        clear_btn.addActionListener(new FileServer_clear_btn_actionAdapter(this));
        clear_btn.setBounds(new Rectangle(323, 245, 86, 13));
        clear_btn.setToolTipText("");
        stop_btn.setToolTipText("");
        stop_btn.setBounds(new Rectangle(55, 246, 86, 13));
        stop_btn.setText("Stop");
        stop_btn.addActionListener(new FileServer_stop_btn_actionAdapter(this));
        this.addWindowListener(new FileServer_this_windowAdapter(this));
        this.getContentPane().add(textscrollpane, null);
        this.getContentPane().add(stop_btn, null);
        this.getContentPane().add(clear_btn, null);
        textscrollpane.getViewport().add(log, null);
        log.setText("Server Initiated Listening on Port [9898]...");
      void stop_btn_actionPerformed(ActionEvent e) {
        System.exit(0);
      void this_windowClosed(WindowEvent e) {
        System.exit(0);
      void this_windowClosing(WindowEvent e) {
    System.exit(0);
      void clear_btn_actionPerformed(ActionEvent e) {
      log.setText("");
    class FileServer_stop_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_stop_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.stop_btn_actionPerformed(e);
    class FileServer_this_windowAdapter extends java.awt.event.WindowAdapter {
      FileServer adaptee;
      FileServer_this_windowAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void windowClosing(WindowEvent e) {
        adaptee.this_windowClosing(e);
    class FileServer_clear_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_clear_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.clear_btn_actionPerformed(e);
    //**********************CLIENT************************************
    package servermanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    public class FileClient {
      Socket socket;
      DataOutputStream dataout;
      public   void SetSocket(String dir,String filename) {
        try {
          socket = new Socket("localhost", 9898);
          dataout = new DataOutputStream(socket.getOutputStream());
            //sending Username & DIR name
            dataout.writeUTF(dir);
            //Sending Filename
            dataout.writeUTF(filename);
            dataout.flush();
            File f = new File("Accounts//"+dir+"//"+filename);
            byte data[]=new byte[4096];  //40k
            long filelength=f.length();
            String lenbuf = String.valueOf(filelength);
             byte lenz[] = lenbuf.getBytes(); //file length in bytes
               int lenzLen = lenz.length;
            FileInputStream fis = new FileInputStream(f);
            dataout.write(lenzLen);  //sending length in integer
            dataout.flush();
            System.out.println(lenzLen+"--------First Thing Sent length of byte array");
            dataout.write(lenz);      //sendinf byte  Array length
            dataout.flush();
              System.out.println(lenz+"--------Second Thing Sent bytes");
            int loop=0;
              while(loop!=-1){
                loop=fis.read(data);
                dataout.write(data);
                dataout.flush();
              socket.close();
        catch (UnknownHostException e) {
          System.out.println("Unknown host:");
          System.exit(1);
        catch (IOException e) {
          System.out.println("No I/O   " + e.getMessage());
          System.exit(1);
        catch (Exception e){
          e.printStackTrace();
      public static void main(String args[])  {
        FileClient serv = new FileClient();
        FileBean file=new FileBean();
        String wavfiles []=null;
        String dirs []=  file.getDirsForSocket("Accounts//");
        for(int i=0;i<dirs.length;i++){
        wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
         //if (wavfiles.length==0)
              for (int j=0;j<wavfiles.length;j++){
                  serv.SetSocket(dirs,wavfiles[j]);

  • Unable to send messages to iphone by ipad 2 by using imessage

    Hello,
    After the ios 5.0, me and my girlfriend tried to use imessage. I have an ipad 2 and she has iphone 4. Even though we both upgraded our software to 5.0, we are unable to send text to each other. She and I can send text to ourselves but we cannot send to each other.
    Anyone any idea why it could happen?
    Thank you.

    I had issues getting iPad and iPhone to actually sync up when sending test iMessages to my wife who also has iOS 5 on her iPhone.
    Whether it was coincidence or not the trick that made it all work was going into both iPhones mine and hers and in the iMessage settings you'll see a field that says caller ID. I changed this option and selected the email address for both iPhones and only after that did I get joy.
    Not sure what that option is and it does NOT make her iPhone pulse an email address to other people she texts...
    Strange but that worked for me.

  • Urzent: Delete files in FTP server using FTP receiver adapter

    Hi Experts,
    We are doing 2 asyncronous scenarios. frst scenario should delete existing file and place the request file. Second scenario should pick(delete) response file and delete request file it placed also.
    Scenario 1 : File(NFS) to FTP  (Asynchronous)
    Scenario 2: FTP to NFS  (Asynchronous)
    Scenario 1: (Receiver FTP Adapter )
    step-1: PI has to delete all existing files in FTP server
    step-2: PI has to place Request file in FTP
    Scenario-2: ( Sender FTP Adapter)
    step-1: PI has to Delete request file i FTP server
    Step-2: PI has to pick and delete response file in FTP server
    Doubts:
    How can we do above steps in PI
    Thanks,
    Murali

    Hi Krish - For scenario -1 You have to make use of the OS commands to delete the files on FTP server before placing the request file.
              -> write some script which wil connect to the FTP server and delete the files.
              -> call that script from the file adapter "using execute OS commands" option
    For scenario -2 :
    pick both the files(request and response) and set the processing mode to delete..
    during the receiver determination, process only request files(based on filename/content)

Maybe you are looking for