I would have 2 questions:
1) Can I use the explorer file to display an Azure directory
containing Blob? If you like ?, to me as an error: The virtual
path relative path ‘www.x.xxx’ is not allowed here.
2) When I try to load a blob on the PDFViewer, I do not see it.
Are there any restrictions on communication with Azure Cloud Storage?
Thank you.
Manuel
|
@*"https://filebrowsercontent.blob.core.windows.net/blob1/Content/"- Specifies the folder path of azure blob storage *@
@*"/FileExplorer/FileActionDefault"- Specifies the URL of Ajax handling method, which is defined at controller part *@
@(Html.EJ().FileExplorer("fileExplorer")
.FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx")
.Path("https://filebrowsercontent.blob.core.windows.net/blob1/Content/")
.AjaxAction(@Url.Content("/FileExplorer/FileActionDefault"))
.Width("900px")
.Height("400px")
.Layout(LayoutType.LargeIcons)
) |
|
//Please specify the path of azure blob
string startPath = "https://filebrowsercontent.blob.core.windows.net/blob1/";
//Here you have to specify the azure account name, key and blob name
AzureFileOperations operation = new AzureFileOperations("filebrowsercontent", "rbAvmn82fmt7oZ7N/3SXQ9+d9MiQmW2i1FzwAtPfUJL9sb2gZ/+cC6Ei1mkwSbMA1iVSy9hzH1unWfL0fPny0A==", "blob1"); |
Thanks for reply, i solved for the file Explorer but how can pass the strem of pdf from controller to view?
Controller:
MemoryStream ms = new MemoryStream();
blob.DownloadToStream(ms);
ViewData["BlobStream"] = ms;
View:
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl(ViewData["BlobStream"].ToString())
.PdfService(Syncfusion.JavaScript.PdfViewerEnums.PdfService.Remote))
The pdf don't render.
Thanks in advance.
|
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl(“../api/PdfViewer”).PdfService(Syncfusion.JavaScript.PdfViewerEnums.PdfService.Local))
// Where “PdfViewer” in the code snippet is the web API controller(PdfViewerController). |
|
PdfViewerHelper helper = new PdfViewerHelper();
if (jsonResult.ContainsKey("isInitialLoading"))
{
CloudBlobContainer _cloudBlobContainer = _blobClient.GetContainerReference(_containerName);
CloudBlockBlob _blockBlob = _cloudBlobContainer.GetBlockBlobReference("HTTP Succinctly.pdf");
MemoryStream memoryStream = new MemoryStream();
_blockBlob.DownloadToStream(memoryStream)
helper.Load(memoryStream);
} |
Ok perfect, it's work!
i have another question:
If i want pass a parameter from view to webapi controller, where can i put that parameter?
Example:
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl(“../api/PdfViewer/parameter?”).PdfService(Syncfusion.JavaScript.PdfViewerEnums.PdfService.Local))
Thanks!
|
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}/{action}",
defaults: new { id = RouteParameter.Optional }
);
} |
|
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl("../api/PdfViewer/10")) |
|
public object Load(int id, Dictionary<string, string> jsonResult)
{
}
//where id will retrieve the value 10 which we have passed from the view page |