In .NET core we have override CreateSessionDataStorage method to give response as blob stream , below is sample code
Code: Select all
protected override IDataStorage CreateSessionDataStorage(string sessionId)
{
return new BlobDataStorage();
}
public class BlobDataStorage : IDataStorage
{
public object GetItemCopy(string key)
{
if (Contains(key))
{
var blobclient = new BlobClient("UseDevelopmentStorage=true", "service",key);
return blobclient.OpenRead();
}
else
throw new Exception(string.Format("Data storage does not have image with identifier \"{0}\".", key));
}
...
same method GetImageFileInfo() i override as as response stream from physical 1260 array of jpg file it is only take 3 sec
Code: Select all
protected override IDataStorage CreateSessionDataStorage(string sessionId)
{
if (sessionId == null)
{
if (IsEmptySessionSupported)
sessionId = "";
else
throw new ArgumentNullException("sessionId");
}
string path = Path.Combine("C:\\Jwalit\\Sample Files\\JPEGNEW\\", sessionId);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
return new StreamDataStorage(path);
}
Thanks
Jwalit katira