<div dir="ltr"><div><div><div><div><div>Good morning community,<br><br></div>This is the topology I have (I am using ndn-js on both consumer and producer side):</div><div><br></div><div>    PRODUCER------NFD-----CONSUMER</div><div><br></div><div>I am trying to create a data packet on the producer side every time it receives an interest packet from the consumer.</div><div>The producer is sending an image; therefore it means that I have to split the contents into chunks of fixed dimension. </div><div>This is what I do:</div><div>1) var files = document.getElementById('files').files;</div><div>    var file = files[0];<br></div><div>2) I get the blob object from the file <br></div><div>    var blob = file.slice(start,end);<br></div><div>    printLine("The dimension is "+blob.size);--> the dimension is the right one</div><div>3) I store the blob object into the data object using the method data.setContent(blob)</div><div>4) When I want to get the dimension from the data content the result of the print is 0.<br></div><div><br></div><div>var dim = data.getContent().size(<br>   function() { <br><br>     if (this.buffer != null) <br>        return this.buffer.length; <br>        else return 0; <br><br>   });<br>  <br>  printLine("The dimension is " +dim);---->0<br></div><div><br></div><div>What's wrong in what I have done?</div><div><br></div><div>Thank you.</div><div>Giuseppe.<br></div></div></div></div></div>