Hi Jay,

Thank you for the quick response.

Here are the steps I followed:

1.       On Server side, stored a file into an array of bytes and set value on 
POST using OCRepresentation.setValue(?file_contents?, byte_array).

2.       The client on receiving the data via a GET call, will read the 
contents of the array and write it to a file.

The problem here is since the performance depends largely on the size of the 
file, a file size of 68KB takes less than 3 seconds whereas file of size 7MB 
takes 3.14 minutes. Did you run into the same problem on transferring a file 
size of 50MB?

Let me know if you have any thoughts.

Thank you,
Vandita


From: Junghyun Oh [mailto:[email protected]]
Sent: Friday, February 17, 2017 6:55 PM
To: Venuturapalli, Vandita <vandita.venuturapalli at intel.com>
Cc: iotivity-dev at lists.iotivity.org
Subject: Re: [dev] Transferring large files through IoTivity


Hi Vandita,

You can use the ?byte? data type to transfer a file.
Let me share you the example representation so that you could get a tip for 
your need.

     /file/transfer
     {
          rt          : [?x.com<http://x.com>.mycompany.file.transfer?],
          if           : [?oic.if.s?],
          blob       : ?alsutomqcijrt;oqmjrogkjmdiou209?..(byte string value) 
?,     <? BYTE data type
          size       : 1000                                                     
                                   <? int64_t data type.
     }

I have tested with 50MB file and it worked fine.
However, you will need to check and find the proper file size which meets your 
goal
?cause the speed performance varies based on the file size.

I hope this would help you.

Thank you.
Jay.


2017. 2. 18. ?? 4:18, Venuturapalli, Vandita <vandita.venuturapalli at 
intel.com<mailto:vandita.venuturapalli at intel.com>> ??:

Hello,

Is there a mechanism to send Files using IoTivity. I am looking to implement 
file transfer between the server and client and have a few questions:
1.       This link (https://wiki.iotivity.org/block-wise_transfer) talks about 
block-wise transfers.  Can this be extended to transfer files between the 
Client and Server? What are the APIs I can use?
2.       Is there a limit on the size of the files transferred?
3.       Can a file be considered as  a resource and be sent across devices?

I was wondering if anyone has come across these use cases before and could help 
answer my questions.

Thank you,
Vandita
_______________________________________________
iotivity-dev mailing list
iotivity-dev at lists.iotivity.org<mailto:iotivity-dev at lists.iotivity.org>
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170301/72e546a5/attachment.html>

Reply via email to