static ByteRange ByteRangeRemainingForDownload(string filepath)
{
/*
* Initialize the ByteRange as the whole file.
* long.MaxValue works regardless of the size because
* S3 will stop sending bits if you specify beyond the
* size of the file anyways.
*/
ByteRange byteRange = new ByteRange(0, long.MaxValue);
if (File.Exists(filepath))
{
FileInfo info = new FileInfo(filepath);
byteRange.Start = info.Length;
}
return byteRange;
}
#endif