コード例 #1
0
        //
        // GET: /Files/Details/5

        public ActionResult Details(int id = 0)
        {
            var file = _filesRepository.GetFileById(id);

            if (file == null)
            {
                return(HttpNotFound());
            }

            return(View(file));
        }
コード例 #2
0
        /// <summary>
        ///     Download new files uploaded using the website.
        /// </summary>
        /// <param name="metadata"></param>
        /// <returns></returns>
        public FileSyncContent DownloadFile(FileMetadata metadata)
        {
            File file = _filesRepository.GetFileById(metadata.Id);

            return(new FileSyncContent
            {
                Data = file.Data,
                Description = file.Description,
                FileContent = file.FileContent,
                FileName = file.FileName,
                FileType = file.FileType,
                Id = file.Id,
                UserId = file.UserId
            });
        }