My question is the same as this one but for c#: [PHP, get file name without file extension](https://stackoverflow.com/questions/2183486/php-get-file-name-without-file-extension)

Please see the code below:

```
[HttpGet("{id}")]
public ActionResult<byte[]> Get(Guid id)
{
    return System.IO.File.ReadAllBytes("Pictures\\" + id );
}

```

The filetype e.g. jpeg, gif etc is unknown. How do I find the file without a file type?

Do I have to insist that all images are submitted in a particular file format?

What is the most elegant way of doing this?