Ejemplo n.º 1
0
        public static string FileDownURL(IFile file)
        {
            if (file is Attachment)
            {
                file = file as Attachment;
            }
            else if (file is IESFile)
            {
                file = file as IESFile;
            }
            else if (file is IES.Resource.Model.File)
            {
                file = file as IES.Resource.Model.File;
            }

            ResourceServer server = StoreServie.ResourceServer_Get(file.ServerID);

            return(string.Format(downurl, server.Host, server.IISPort, server.IISFolder, file.FileName));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 文件在线浏览地址 :TODO
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public static string FileViewURL(IFile file)
        {
            if (file is Attachment)
            {
                file = file as Attachment;
            }
            else if (file is IESFile)
            {
                file = file as IESFile;
            }
            else if (file is IES.Resource.Model.File)
            {
                file = file as IES.Resource.Model.File;
            }

            string         ext    = StringHelp.GetFileNameExt(file.FileName).ToLower();
            ResourceServer server = StoreServie.ResourceServer_Get(file.ServerID);

            return(string.Format(downurl, server.Host, server.NginxPort, server.NginxFolder, file.FileName));
        }