Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading files in a ASP.NET MVC Web api controller

I want to create a WEB API that uploads a file from a given client onto a Azure. For this, I know I can use a class like: MultipartFormDataStreamProvider (not sure if this class works for Azure)

I want this API to be accessible from a variety of applications. For starters a simple .NET application. But my question is can I use this same API to handle file uploads from say an Android application, Windows 8 application, etc?

If this is not possible then do all these applications require a separate API exposed?

My idea of an API is that it can be used across a variety of applications for required functionality. But in this case the classes required to upload the file will restrict its usage.

like image 731
nikhil pinto Avatar asked Mar 21 '23 14:03

nikhil pinto


1 Answers

@nikhil pinto: The ASP.NET Web API helps you to create REST-Web service which can be consumed by any kind of client supporting HTTP request. I found this article here

http://hintdesk.com/android-upload-files-to-asp-net-web-api-service

very good because it illustrates how we can call the web service from different clients. Just check it out.

like image 64
Tri Nguyen Avatar answered Mar 31 '23 14:03

Tri Nguyen