Git Product home page Git Product logo

azure-aspcore-file-provider's Introduction

azure-aspcore-file-provider

This repository contains the ASP.NET Core Azure storage file system providers for the Syncfusion File Manager component.

Key Features

Azure file system provider serves the file system support for the FileManager component with the Microsoft Azure blob storage.

The following actions can be performed with Azure file system Provider.

Actions Description
Read Reads the files from Azure blob container.
Details Provides details about files Type, Size, Location and Modified date.
Download Downloads the selected file or folder from the Azure blob.
Upload Uploads a files to Azure blob. t accepts uploaded media with the following characteristics:
  • Maximum file size: 30MB
  • Accepted Media MIME types: */*
Create Creates a new folder.
Delete Removes a file from Azure blob.
Copy Copys the selected Files from target.
Move Pastes the copied files to the desired location.
Rename Renames a folder or file.
Search Searches a file or folder in Azure blob.

Prerequisites

In order to run the service, we need to create the Azure blob storage account and register the Azure storage details like account name, password and blob name details with in the RegisterAzure method.


  RegisterAzure(string accountName, string accountKey, string blobName)

How to run this application?

To run this application, clone the azure-aspcore-file-provider repository and then navigate to its appropriate path where it has been located in your system.

To do so, open the command prompt and run the below commands one after the other.


git clone https://github.com/azure-aspcore-file-provider  azure-aspcore-file-provider

cd azure-aspcore-file-provider

Running application

Once cloned, open solution file in visual studio.Then build the project after restoring the nuget packages and run it.

File Manager AjaxSettings

To access the basic actions such as Read, Delete, Copy, Move, Rename, Search, and Get Details of File Manager using Azure service, just map the following code snippet in the Ajaxsettings property of File Manager.

Here, the hostUrl will be your locally hosted port number.

  var hostUrl = http://localhost:62870/;
  ajaxSettings: {
        url: hostUrl + 'api/AzureProvider/AzureFileOperations'
  }

File download AjaxSettings

To perform download operation, initialize the downloadUrl property in ajaxSettings of the File Manager component.

  var hostUrl = http://localhost:62870/;
  ajaxSettings: {
        url: hostUrl + 'api/AzureProvider/AzureFileOperations',
        downloadUrl: hostUrl +'api/AzureProvider/AzureDownload'
  }

File upload AjaxSettings

To perform upload operation, initialize the uploadUrl property in ajaxSettings of the File Manager component.

  var hostUrl = http://localhost:62870/;
  ajaxSettings: {
        url: hostUrl + 'api/AzureProvider/AzureFileOperations',
        uploadUrl: hostUrl +'api/AzureProvider/AzureUpload'
  }

File image preview AjaxSettings

To perform image preview support in the File Manager component, initialize the getImageUrl property in ajaxSettings of the File Manager component.

  var hostUrl = http://localhost:62870/;
  ajaxSettings: {
        url: hostUrl + 'api/AzureProvider/AzureFileOperations',
         getImageUrl: hostUrl +'api/AzureProvider/AzureGetImage'
  }

The FileManager will be rendered as the following.

File Manager

Support

Product support is available for through following mediums.

License

Check the license detail here.

Changelog

Check the changelog here

© Copyright 2019 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution.

azure-aspcore-file-provider's People

Contributors

bhuvaneswarin avatar gsumankumar avatar indhumathy-loganathan avatar keerthanarajendran avatar kmkrish001 avatar mydeen-sn avatar prasanthmadhaiyan avatar premkumarmadhanraj avatar rajendranr-5483 avatar sarubala20 avatar shameeralibaig avatar sivakumars3442 avatar sowmiyapadmanaban avatar suba-1997 avatar syncfusionbuild avatar thirukumaran-murugan avatar vishwanathan3797 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-aspcore-file-provider's Issues

Download not working for private Blob-Container

Download of single files uses a WebClient for downloading the file.
If the Azure Blob Storage Container is not set to public access, this will result in a Status 404 (Resource not found).

FileStreamResult fileStreamResult = new FileStreamResult(new MemoryStream(new WebClient().DownloadData(this.filesPath + selectedItems[0].FilterPath + names[0])), "APPLICATION/octet-stream"); fileStreamResult.FileDownloadName = file.Name; return fileStreamResult;

To support private Blob Container's aswell, the Azure Blob Storage library should be used to download the file's.

The controller methods do not work with swashbuckle/ swagger

Greetings from Syncfusion,

 

We would like to inform you that swagger document generator needs Http method instead of Routes. So, we kindly suggest you to replace the Route method to Http method. Refer the suggestion below to resolve the issue,

 

[Route("FileOperations")] | [HttpPost("FileOperations")] -- | -- [Route("Download")] | [HttpGet("Download")] [Route("Upload")] | [HttpPost("Upload")] [Route("GetImage")] | [HttpGet("GerImage")]

 

 

You can also refer the below link for the further references,

 

https://stackoverflow.com/questions/62959061/swagger-error-ambiguous-http-method-for-action-actions-require-explicit-httpmeth

Project not run

The solution wont´t start, possibly it's the specific version of netcore. In requirements, indicate which version of netcore you use please

imagen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.