Search code examples
asp.net-mvc-4jquery-file-uploadbackload

How does jQuery's FileUpload's Backload connect with UploadHandler?


I got jQuery File Upload along with Backload up and running in Visual Studio, straight out of NuGet. The demo works just fine, I can upload files. I'm using the default configuration.

http://blueimp.github.io/jQuery-File-Upload/basic.html
https://github.com/blackcity/Backload

BackloadDemo/Index.cshtml has the following form:

<form id="fileupload"
      action="/Backload/UploadHandler" 
      method="POST" 
      enctype="multipart/form-data">

It works, but I can't figure out how it works. Where does /Backload/UploadHandler link to? I cannot find any reference of this 'UploadHandler'.


Solution

  • I was trying to figure the same thing out and I have found the answer.

    If you check the Backload.dll you will see a namespace of Backload.Controllers with a class named BackloadController.

    This is the controller that is picking up and handling the request. ASP.Net uses reflection to gather all classes that end with Controller and inherit from Controller. The reason you can't see this controller in the Controllers folder is because they are embedding the implementation inside the Backload.dll

    enter image description here