Results 1 to 2 of 2

Thread: How can I get the percentage of file transfer

  1. #1
    fengshengheli is offline Registered User
    Name: zhang mq
    Organization: sddl
    Project: substation
    Join Date
    Sep 2008
    Posts
    9

    Smile How can I get the percentage of file transfer

    ask:
    I write the slice like this:

    bool getFile(string filename);

    The server get the file from a remote machine and return true or false when transfering completed. I don't know how to send messages to the client when transfering.

    How can I get the percentage of file transfer when the client invoking this function? Can you help me?

    answer:
    I would use some callback interface to do this. You could do something like this:

    Code:
    interface TransferFileCallback
    {
    void transferred(float f); // Percentage transferred between 0 and 1.
    void failed(string reason); // Transfer failed.
    };

    interface TransferFile
    {
    // Returns true if the file will be transferred, false otherwise.
    bool getFile(string filename, PercentageCallback* cb);
    };

    New Question:
    It works well when the client-side using vc++. But my client is using PHP. How can I create callback in the php? I find not "Server-Side Slice-to-PHP Mapping" in the pdf. What can I do in this case?

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    I'd suggest to study the Chat demo, in particular its PHP client.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to do file transfer when use iceStrom
    By xiao weiqing in forum Help Center
    Replies: 2
    Last Post: 07-26-2011, 09:41 PM
  2. How can I get the percentage of file transfer
    By fengshengheli in forum Help Center
    Replies: 4
    Last Post: 09-09-2008, 08:51 PM
  3. File transfer and threading.
    By EmmanuelOga in forum Help Center
    Replies: 3
    Last Post: 08-15-2006, 09:41 AM
  4. Any Example that do file transfer out there
    By alexm in forum Help Center
    Replies: 2
    Last Post: 04-06-2006, 05:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •