I have build the SingnalR chat application MVC5 signalR 2.0 , from the tutorial :- http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20-and-mvc-5 And it is all working brilliantly, though is there a way to send images/ attachments? and with the images actually displaying on the screen?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- MVC-Routing,Why i can not ignore defaults,The matc
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
I would advise you - send images and messages by WebApi (no SignalR), and then notify all participants in the chat by SignalR.
This file uploading using file input bootstrap plugin (krajee) You can also upload file without using this plugin.
Hub class code
No. SignalR is a text base signaling. All you can do -- is send urls, json.. Or you may consider to transfer base64 string representation of an image, but I bet it is not very frendly usage case.
The way that Jabbr (the IRC-like web based chat system based on SignalR) does it is it uploads files to an Azure blob container from the client (via a server side upload handler) and then sends the direct blob URI back down to all clients, who access the file directly.
Take a look at the code here: https://github.com/JabbR/JabbR