I want to upload a file from the client to the server. Is there a way to upload a file with SignalR or must i need a Controller for this?
Uploading a file in Asp.Net MVC application is very easy. The posted file is automatically available as a HttpPostedFileBase parameters in the action of the controller. For uploading a file on the server you required to have a file input control within html form having encoding type set to multipart/form-data.
SignalR is relevant for now, it supports mobile devices, and many other things. SignalR is the same WebSocket but with many ready stuff. You can use raw WebSocket instead of it, but you will have to do many things to gain what you want. So SignalR is more easy to use.
SignalR and WebSocketSignalR uses the new WebSocket transport where available and falls back to older transports where necessary. While you could certainly write your app using WebSocket directly, using SignalR means that a lot of the extra functionality you would need to implement is already done for you.
SignalR is for real time messaging not uploading files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With