Streaming with IAttachmentFile
Posted: Wed Oct 21, 2020 8:05 am
Hi-
In order to efficiently handle the creation (and extraction) of large attachments with SPS, we're interested in the IAttachmentFile's CopyTo( ) method, which accepts a Stream.
1) I'm assuming I can build a class which derives from Stream and is capable of providing the next set of bytes from my Source whenever the SDK calls Read on the given Stream within the CopyTo's implementation. Is that a safe assumption?
2) As the bytes are streamed to the IAttachmentFile via the CopyTo( ) method, are they accumulating in the client's memory footprint, or is the SDK sending them on to the server for appending to the corresponding Blob storage ? Put another way, if we use this operation, and then the user closes the open Order without saving, what happens to the new attachment ? Kept or discarded?
Thank you.
-Todd
In order to efficiently handle the creation (and extraction) of large attachments with SPS, we're interested in the IAttachmentFile's CopyTo( ) method, which accepts a Stream.
1) I'm assuming I can build a class which derives from Stream and is capable of providing the next set of bytes from my Source whenever the SDK calls Read on the given Stream within the CopyTo's implementation. Is that a safe assumption?
2) As the bytes are streamed to the IAttachmentFile via the CopyTo( ) method, are they accumulating in the client's memory footprint, or is the SDK sending them on to the server for appending to the corresponding Blob storage ? Put another way, if we use this operation, and then the user closes the open Order without saving, what happens to the new attachment ? Kept or discarded?
Thank you.
-Todd