public static TagBuilder Best(string bestName, Guid id) { var image = Urls.ContentRoot( GetBestNameFull(bestName) + id + Urls.PhotoExt); return(HtmlControls.Image(image)); }
public static string SaveMessageImage(HttpFileCollectionBase files, int userID) { foreach (string file in files) { var hpf = files[file]; if (hpf.ContentLength == 0) { return(string.Empty); } var fileName = Path.GetFileName(hpf.FileName); var sysName = GetMessageFileSys(userID, fileName); SaveFileWithResize(hpf, sysName, 800); return(Urls.ContentRoot(Urls.FullMessageImage + userID + "/" + fileName)); } return(string.Empty); }
public static string GetFileUrl(int fileID) { var directoryInfo = GetDirectoryInfo(fileID); if (!directoryInfo.Exists) { return(null); } var fileInfos = directoryInfo.GetFiles(); if (fileInfos.Length == 0) { return(null); } return(Urls.ContentRoot(GetInnerUserFilePath(fileID) + fileInfos[0].Name)); }