Problem with MVC widget with multiple actions
I have a MVC widget that pulls information from our Active Directory to display for the user. One of the data items is an image stored within the directory. In order to be able to present the image, I've added an Action to the Controller for the View to be able to request the image. It also includes returning a default image should the directory not contain an image.
However, when viewing the widget on a Sitefinity page, the images never show. I've used Fiddler to confirm that the requests are being made from the View, and I can debug the code to see it is hitting the Action. The odd thing is that Fiddler is showing the return from the Action being the whole View, not the image I wanted.
Any ideas? The code for the Action on the Controller is below (I'm sure this must be where the problem is)
I am not able to reproduce the issue on my end. Both FilePathResult and FileStreamResult work fine on Sitefinity 7.2. Could you please specify the Sitefinity version you are using? Here is a video (screencast.com/.../bsm2AWj4b) showing the actions functionality in a simple widget.
Is your default sitefinity images library setup to serve images from /images? ...maybe like a path conflict?
I was running the project under 7.1. As you had it working on 7.2, I've just upgraded the project to 7.2, and now it works! So, I guess it must have been a bug in 7.1?
The issue with FileResult and I/O actions was fixed in internal build 7.1.5213. You can review the bug that is fixed here.