Beispiel #1
0
        public static HttpFileCollectionBase GetMediaFromValues(this NameValueCollection values)
        {
            IMediaPathField       mediaPathField = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve <IMediaPathField>();
            HttpFileCollectionImp files = new HttpFileCollectionImp();
            string key = "_____MediaBinaryString_____", str = values[key];

            if (!string.IsNullOrWhiteSpace(str))
            {
                var binarys = mediaPathField.ToBinaryStream(str);
                foreach (var keyValue in binarys)
                {
                    files.AddFile(key, keyValue.Key, "", keyValue.Value);
                }
                values[key] = "";
            }
            return(files);
        }
        public static HttpFileCollectionBase GetFilesFromValues(this NameValueCollection values)
        {
            IVirtualPathField virtualPathField = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<IVirtualPathField>();
            HttpFileCollectionImp files = new HttpFileCollectionImp();
            foreach (string key in values.AllKeys)
            {
                var value = values[key];
                if (virtualPathField.IsBinaryString(value))
                {
                    var binarys = virtualPathField.ToBinaryStream(value);
                    foreach (var keyValue in binarys)
                    {
                        files.AddFile(key, keyValue.Key, "", keyValue.Value);
                    }
                    values[key] = "";
                }
            }

            return files;
        }
Beispiel #3
0
        public static HttpFileCollectionBase GetFilesFromValues(this NameValueCollection values)
        {
            IVirtualPathField     virtualPathField = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve <IVirtualPathField>();
            HttpFileCollectionImp files            = new HttpFileCollectionImp();

            foreach (string key in values.AllKeys)
            {
                var value = values[key];
                if (virtualPathField.IsBinaryString(value))
                {
                    var binarys = virtualPathField.ToBinaryStream(value);
                    foreach (var keyValue in binarys)
                    {
                        files.AddFile(key, keyValue.Key, "", keyValue.Value);
                    }
                    values[key] = "";
                }
            }

            return(files);
        }
Beispiel #4
0
 public static HttpFileCollectionBase GetMediaFromValues(this NameValueCollection values)
 {
     IMediaPathField mediaPathField = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<IMediaPathField>();
     HttpFileCollectionImp files = new HttpFileCollectionImp();
     string key = "_____MediaBinaryString_____", str = values[key];
     if (!string.IsNullOrWhiteSpace(str))
     {
         var binarys = mediaPathField.ToBinaryStream(str);
         foreach (var keyValue in binarys)
         {
             files.AddFile(key, keyValue.Key, "", keyValue.Value);
         }
         values[key] = "";
     }
     return files;
 }