CreateBinaryData() public static method

Creates BinaryData from HttpPostedFile
public static CreateBinaryData ( System.Web.HttpPostedFile file ) : BinaryData
file System.Web.HttpPostedFile
return SenseNet.ContentRepository.Storage.BinaryData
コード例 #1
0
ファイル: UploadHelper.cs プロジェクト: pchaozhong/FlexNet
        /// <summary>
        /// Creates new Node of specified Content Type
        /// </summary>
        /// <param name="contentTypeName"></param>
        /// <param name="parent"></param>
        /// <param name="fileName"></param>
        /// <param name="stream"></param>
        public static void CreateNodeOfType(string contentTypeName, Node parent, string fileName, Stream stream)
        {
            var node = new SenseNet.ContentRepository.File(parent, contentTypeName);

            if (CheckAllowedContentType(parent as GenericContent, node))
            {
                node.Name = fileName;
                node.SetBinary("Binary", UploadHelper.CreateBinaryData(fileName, stream));
                node.Save();
            }
        }
コード例 #2
0
ファイル: UploadHelper.cs プロジェクト: vlslavik/SenseNet
 /// <summary>
 /// Modify node's binary
 /// </summary>
 /// <param name="node"></param>
 /// <param name="stream"></param>
 public static void ModifyNode(Node node, Stream stream)
 {
     node.SetBinary("Binary", UploadHelper.CreateBinaryData(node.Name, stream));
     node.Save();
 }
コード例 #3
0
 // ------------------------------------------------------------------ Static methods
 public static BinaryData CreateBinaryData(HttpPostedFile file)
 {
     return(UploadHelper.CreateBinaryData(file));
 }