public string Put() { string accessUrl = string.Empty; try { using (FileService fileService = new FileService()) { var stream = Request.Content.ReadAsStreamAsync().Result; if (stream.Length == 0) { throw new Exception("Files are not exists in request"); } accessUrl = fileService.AddOrUpdateByName(GetAuthKeyFromHeader(), GetFolderFromHeader(), DateTime.Now.Ticks.ToString() + "-" + GetRealFileName(), stream, GetRename()); } } catch (Exception ex) { ActivityService.LogException(ex); } return(accessUrl); }