Hello.
I got a PictureBox that the URI is a call to an action method :
="https://mysite.com/Stocks/Dwnlod/" + CStr(Fields.PhysicalName)
I use ASP.NET MVC Core and my pictures are not in wwwroot. They are under another directory of the project.
So I use a method to get the filestream of the file :
[Authorize]
public async Task<
FileStreamResult
> Dwnlod(string id)
{
...
var memory = new MemoryStream();
try
{
using (var stream = new FileStream(path, FileMode.Open))
{
await stream.CopyToAsync(memory);
}
}
catch (Exception e)
{
}
memory.Position = 0;
return File(memory, GetContentType(path), Path.GetFileName(path));
}
As you can see my action method is decorated [Authorize] so it's impossible to get the stream from the report even if the user is connected and authenticated. The call of URI from the report seem be anonyous. So i got a error (of course everything works #1 when I remove the decoration Authorize).
Any suggestion to keep [Authorize]? Can the report can provide some authenification when the URI is called?
Thank you all of you at Telerik.