Note: You must first create a folder in the root directory of your project called locker. Return iUploadedCnt + " Files Uploaded Successfully" SaveAs(sPath + Path.GetFileName(hpf.FileName)) If (!File.Exists(sPath + Path.GetFileName(hpf.FileName))) CHECK IF THE SELECTED FILE(S) ALREADY EXISTS IN FOLDER. DEFINE THE PATH WHERE WE WANT TO SAVE THE FILES. Public class FileUploadController : ApiController From the Template dropdown list, choose Empty MVC controller and click the Add button. In the Add Controller window, type FileUploadController in the Controller Name box. Find Controllers folder, right click it and choose Add and Controller…. Open the Solution Explorer window in the project. Therefore, let’s create the Controller for our WebAPI. If you are newbie in Web API, then I would recommend you to check the below link for step by step creation and implementation of your first Web API application. From the Project Template under New ASP.NET MVC 4 Project, select Web API template and press OK. ![]() Choose the language you prefer and select Web -> Asp.Net MVC4 Web Application. In the New Project window, you will find a list of “Installed Templates”. Start Visual Studio and from the top left choose File -> New Project. You can call a Web API controller from any client application, which is capable of making an http POST request either using jQuery Ajax or XMLHttpRequest object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |