コード例 #1
0
        public ActionResult Base64Str(string base64str)
        {
            MemoryStream     stream           = new MemoryStream(Convert.FromBase64String(base64str.Split(',')[1]));
            StreamFileHelper streamFileHelper = new StreamFileHelper();
            UPLOAD           upload           = RemotingHelp.GetModelObject <UPLOAD>();

            return(Json(upload.Upload(streamFileHelper.StreamToBytes(stream), DateTime.Now.Millisecond.ToString() + ".png", "webadmin"),
                        JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult File()
        {
            var file   = Request.Files["file"];
            var name   = file.FileName;
            var stream = file.InputStream;
            StreamFileHelper streamFileHelper = new StreamFileHelper();
            UPLOAD           upload           = RemotingHelp.GetModelObject <UPLOAD>();

            return(Json(upload.Upload(streamFileHelper.StreamToBytes(stream), name, "webadmin"),
                        JsonRequestBehavior.AllowGet));
        }