I'm trying to read the binary data of a published binary using the following code:
Tridion.ContentDelivery.DynamicContent.BinaryFactory factory = new BinaryFactory();
BinaryData binaryData = factory.GetBinary(uri.ToString());
This worked fine, until I deployed it in an environment where the binaries are stored on the file system rather than the broker database. Now, the BinaryData is always null, even though I'm sure that the file exists.
Is it mandatory to store your binaries in a database if you want to use the BinaryFactory like this? Or am I missing something?