AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 17.10.2018, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsnavax: Send file to temp blob storage in #MSDyn365FO
Источник: http://dynamicsnavax.blogspot.com/20...torage-in.html
==============

In this post I will talk about sending a file to a temporary blob storage. A little warning before I get into it.

This is using the Microsoft’s blob storage that is provisioned for us. I haven’t given it a lot of thought on how it would behave in production. Take it at your own risk.

Lets start by looking back on a couple of posts last month on printing a report to a byte array.

http://dynamicsnavax.blogspot.com/20...-via-x-in.html

http://dynamicsnavax.blogspot.com/20...t-as-byte.html

You can use those sample pieces of code to get a report as a stream and send it to the below code.


if (stream)
{
str fileName = 'myfile';
str contentType = 'application/pdf';
str fileExtension = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);

FileUploadTemporaryStorageStrategy fileUploadStrategy = new FileUploadTemporaryStorageStrategy();
FileUploadTemporaryStorageResult fileUploadResult = fileUploadStrategy.uploadFile(stream, fileName + fileExtension, contentType , fileExtension);

if (fileUploadResult == null || !fileUploadResult.getUploadStatus())
{
warning("@ApplicationPlatform:FileUploadFailed");
}
else
{
downloadUrl = fileUploadResult.getDownloadUrl();
if (downloadUrl == "")
{
throw Exception::Error;
}
}
}
A download URL will be generated for you. The URL is going to be public and with an expiration (15 minutes I believe).

Below is an error if you try to access it after the expiration period.





Источник: http://dynamicsnavax.blogspot.com/20...torage-in.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsnavax: Send to Azure Service Bus in #MSDyn365FO Blog bot DAX Blogs 0 30.09.2018 15:14
ievgensaxblog: D365FO. Working with Azure File storage. Blog bot DAX Blogs 0 16.07.2017 13:14
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 Blog bot NAV: Blogs 0 15.05.2016 18:12
DynamicsAxSCM: Change license plate, split quantity, skip and override location during inbound put away Blog bot DAX Blogs 0 27.11.2015 16:11
Microsoft Dynamics CRM Team Blog: Understanding Storage and Storage Notifications in Microsoft Dynamics CRM Online Blog bot Dynamics CRM: Blogs 0 25.07.2013 08:12
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 07:26.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.