Ejemplo n.º 1
0
        /*
         * helper for above
         */
        private string SaveFile(string folder, object sender2)
        {
            Uploader that = sender2 as Uploader;

            string fileName = Page.Server.MapPath(folder.Trim('/') + "/" + that.GetFileName());

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            byte[] content = Convert.FromBase64String(that.GetFileRawBASE64());
            using (FileStream stream = File.Create(fileName))
            {
                stream.Write(content, 0, content.Length);
            }
            return(folder.Trim('/') + "/" + that.GetFileName());
        }