Notifications
Announcements
No record found.
Hello,In Ax 2012 I could use AifXmlViewer::construct(my_xml, AifXmlType::XML).show() to display xml content. I can't do that in D365FO. I find out the WebsiteHostControl can display xml in similar way but I need to pass the URL to that file. It works only if its ContentType is Application/XML or Text/XML. The problem is where I'm using File::GetFileFromUser(classstr(XMLFileUploadTemporaryStorageStrategy)) or even uploadStrategy.uploadFile(stream, 'MyFile.xml', 'application/xml') the uploaded file has always Content Type "application/octet-stream".So my question is what is the simplest method to upload file with 'application/xml' content type to default D365 temporary storage or what is the best method to show xml with collapsible sections and colored texts similarly to AifXmlViewer?
Hi D365FODev1231223,
Do you mean you want to set the content type of the file of 'application/xml' to the default D365 temporary storage? The file upload control lets users upload a file in D365fo. It also lets developers control the upload process and manage the file that is uploaded, based on their requirements. The FileTypesAccepted property of the file upload control lets you limit the types of files that users can upload. The file types that users can upload are primarily controlled by the associated upload strategy.
learn.microsoft.com/.../file-upload-control
Hello Judy,I will explain it better. Currently I'm using the code below to upload my file to temporary storage.
FileUploadTemporaryStorageStrategy uploadStrategy = new XMLFileUploadTemporaryStorageStrategy(); FileUploadTemporaryStorageResult result = uploadStrategy.uploadFile(stream, 'MyFile.xml', 'application/xml') as FileUploadTemporaryStorageResult;
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 584 Most Valuable Professional
André Arnaud de Cal... 499 Super User 2025 Season 2
Sohaib Cheema 254 User Group Leader