Results 1 to 3 of 3

Thread: Any Example that do file transfer out there

  1. #1
    alexm is offline Registered User
    Name: Eskinder Alex Mesfin
    Organization: Medtronic, Inc.
    Project: www.medtronic.com
    Join Date
    Apr 2006
    Location
    In Minneapolis, Mn
    Posts
    16

    Any Example that do file transfer out there

    I 've looked through previous posting regarding file transfers, did'nt worked well for me in IcePy, so I am wondering if any examples out there I can try out as a strtup.
    Alex Mesfin
    Medtronic, Inc.
    www.medtronic.com

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    For files up to a few megabytes in size, you can just send them in a single RPC. Something like

    sequence<byte> ByteSeq;
    interface FileStore
    {
    ByteSeq get(string name);
    void put(string name, ByteSeq s);
    };

    should do nicely. Just remember to set up Ice.MessageSizeMax to a value large enough to accommodate the largets file. (The default is 1MB.)

    For really large files, in the tens or hundreds of MB, you will have to to transfer the file in chunks instead. Just make yourself an interface that delivers the file in, say, 1 MB lots, one after the other.

    Cheers,

    Michi.

  3. #3
    alexm is offline Registered User
    Name: Eskinder Alex Mesfin
    Organization: Medtronic, Inc.
    Project: www.medtronic.com
    Join Date
    Apr 2006
    Location
    In Minneapolis, Mn
    Posts
    16
    Hi
    Is the snipet of Slice below:
    sequence<byte> ByteSeq;
    interface FileStore
    {
    ByteSeq get(string name);
    void put(string name, ByteSeq s);
    };
    I implemented as follows:
    in client
    def get( filename):
    fd = open( ...)
    buffer = fd.read( 10240)
    fd.close()
    return buffer

    In server
    buffer = proxy.get( filename)

    I get the followin Error:
    On server
    Traceback (most recent call last):
    File "/malu/abelo/bin/coServer.py", line 42, in initiateSender
    buffer = proxy.get( 10240, current.ctx)
    File "/malu/abelo/coClientServer.ice", line 87, in cliRead
    UnknownException: exception ::Ice::UnknownException
    {
    unknown = exceptions.ValueError: invalid value for element 0 of sequence<byte>
    }
    Shutting down...

    on the client

    echos the server error.

    How do I use/ capture the ByteSeq in my client/callback.
    Last edited by alexm; 04-07-2006 at 07:19 PM.
    Alex Mesfin
    Medtronic, Inc.
    www.medtronic.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. File transfer and ThreadPerConnection
    By José Ángel in forum Help Center
    Replies: 5
    Last Post: 11-05-2008, 10:12 AM
  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. transfer file with Ice
    By zhongshiz in forum Help Center
    Replies: 4
    Last Post: 10-23-2007, 09:00 PM
  4. File transfer and threading.
    By EmmanuelOga in forum Help Center
    Replies: 3
    Last Post: 08-15-2006, 09:41 AM

Posting Permissions

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