When a file is deleted, it is moved into the archive. It will remain in the archive until it is either permanently deleted (DELETE:archive/files/{fileid}) or restored (POST:archive/files/restore/{fileid}). While a file is in the archive, it cannot be modified.
The Content-Disposition, Content-Length, and Content-Type headers provide information about the retrieved file.
The following code example retrieves the archived file with ID 456 and saves it in the caller's temporary directory:
Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
DreamMessage msg = p.At("archive", "files", "456").Get();
using (FileStream fs = System.IO.File.OpenWrite(Path.GetTempPath() + msg.ContentDisposition.FileName))
{
byte[] fileData = msg.AsBytes();
fs.Write(fileData, 0, fileData.Length);
}