Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
SELECT DocumentBody, MimeType
how to read DocumentBody from sql .
The DocumentBody is a base64 encoded string, so you'll need to convert back to binary and save to a file.
For an online converter see - www.motobit.com/.../base64-decoder-encoder.asp
For doing this in c# use File.WriteAllBytes(@"c:\yourfile", Convert.FromBase64String(yourBase64String));
To do this in SQL is a bit tricky - see blogs.msdn.com/.../converting-from-base64-to-varbinary-and-vice-versa.aspx
Hope this helps!
How did you get on? Did this answer your question?
i am trying to write small API in .Net ...
Then you will need to retrieve the base64 string from the document body and then convert to a binary array and save to a file - see stackoverflow.com/.../converting-a-base-64-string-to-an-image-and-saving-it
I hope this answers your question?
I am working with CRM 4.0 and I had a similar issue where the document body column where it seems to be limited by 43679 and with that it gives me an error about an invalid Base 64 string.
'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.'
It seems the file would have more than that to write on that field as the note was a pdf on this CRM 4 database.
The reason why I am trying to do it via code is to recover a few documents that were deleted but still exist in a earlier day backup.
Any ideas how to recover it?
Business Applications communities