File Storage

Most high-profile web sites deliver binary files to the client, such as graphics, video, audio, and PDFs. Regardless of the file type, the minimal HTML pattern for delivering the files is one of the following:

<!-- internal image, video, or audio file -->
<img src="url-to-image.png" />
<video src="url-to-video.mpeg" />
<audio src="url-to-audio.mp3" />

<!-- external file -->
<a href="url-to-spec.pdf">Download the specification"</a>

(There are other attributes for the <img>, <video>, <audio>, and <a> tags.)

In the first three cases, the client renders or plays the media within the web page; in the last case, the client downloads the file external to the web page. In either case, at a minimum the client must receive the file’s URL, and the file must exist in the location implied by the URL. Through Interface StorageItem and associated interfaces and classes, Dari provides high-level functions for maintaining file URLs and locations, as well as other functions for file processing.