Notifications
Announcements
No record found.
Hello exports,
when i try to assign string value to stream, i get the error of data convert :
Cannot implicitly convert from type 'str' to type 'System.IO.Stream'
How i can resolve the problem please ?
Thanks
System.Byte[] byteArray = System.Text.Encoding::get_UTF8().GetBytes(contents); System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
Note: You can find the original at the link below. I wrote it in the Editor for X . There may be minor differences.
stackoverflow.com/.../convert-string-to-system-io-stream
By the way, the variable name (invoicePath) suggests that it contains just a path, not the content of the file. Are you sure that what you want to attach is just the text with the path? If you want to attach the whole file, you need to read it from the path (and assign the content, not the path, to the stream).
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader