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?
This file uploading using file input bootstrap plugin (krajee) You can also upload file without using this plugin.
@section Page{
}
Hub class code
[HubName("ItemHub")]
public class ItemHub : Hub
{
public void GetByteArray(IEnumerable images)
{
foreach (var item in images ?? Enumerable.Empty())
{
var tokens = item.Image.Split(',');
if (tokens.Length > 1)
{
byte[] buffer = Convert.FromBase64String(tokens[1]);
}
}
}
}
public class ImageData
{
public string Description { get; set; }
public string Filename { get; set; }
public string Image { get; set; }
}