I tried to get filename from uploaded file with WebImage like so:
var imageName = new WebImage(file.InputStream).FileName;
but FileName property always return null
maybe im missing something?
To get the filename of the Uploaded file, you can get the image from the request and then call this function on it.
var imageName = new WebImage(file.InputStream).FileName;
..would be
var image = WebImage.GetImageFromRequest().FileName;
This is the property for the image that was uploaded in the Request.
I was looking through the source of the constructor you are using with Reflector and there is no place they set the file name.
But you can probably get the file name using
var fileName = Request.Files[0].FileName;
Its only this constructor that set the file name property:
public WebImage(string filePath)
: this(new HttpContextWrapper(HttpContext.Current), filePath) {}
and of course the private one it uses.