pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='50qya'></bdo><ul id='50qya'></ul>

<legend id='50qya'><style id='50qya'><dir id='50qya'><q id='50qya'></q></dir></style></legend>

    1. <small id='50qya'></small><noframes id='50qya'>

    2. <i id='50qya'><tr id='50qya'><dt id='50qya'><q id='50qya'><span id='50qya'><b id='50qya'><form id='50qya'><ins id='50qya'></ins><ul id='50qya'></ul><sub id='50qya'></sub></form><legend id='50qya'></legend><bdo id='50qya'><pre id='50qya'><center id='50qya'></center></pre></bdo></b><th id='50qya'></th></span></q></dt></tr></i><div class="h9p77pr" id='50qya'><tfoot id='50qya'></tfoot><dl id='50qya'><fieldset id='50qya'></fieldset></dl></div>
    3. <tfoot id='50qya'></tfoot>
    4. 如何使用經典 ASP 保存畫布圖像?

      How to save canvas image using classic ASP?(如何使用經典 ASP 保存畫布圖像?)
    5. <tfoot id='k7r23'></tfoot>
      <i id='k7r23'><tr id='k7r23'><dt id='k7r23'><q id='k7r23'><span id='k7r23'><b id='k7r23'><form id='k7r23'><ins id='k7r23'></ins><ul id='k7r23'></ul><sub id='k7r23'></sub></form><legend id='k7r23'></legend><bdo id='k7r23'><pre id='k7r23'><center id='k7r23'></center></pre></bdo></b><th id='k7r23'></th></span></q></dt></tr></i><div class="37xflpz" id='k7r23'><tfoot id='k7r23'></tfoot><dl id='k7r23'><fieldset id='k7r23'></fieldset></dl></div>
        <legend id='k7r23'><style id='k7r23'><dir id='k7r23'><q id='k7r23'></q></dir></style></legend>
          <tbody id='k7r23'></tbody>
        • <bdo id='k7r23'></bdo><ul id='k7r23'></ul>

                <small id='k7r23'></small><noframes id='k7r23'>

              1. 本文介紹了如何使用經典 ASP 保存畫布圖像?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有點卡在這里.我知道我可以使用 canvas.toDataURL 生成一個 base64 編碼的字符串,以傳遞給我服務器上的經典 ASP 頁面.但我似乎找不到答案的問題是如何處理這些數據,以便我可以將其保存在我的服務器上的某個位置.

                I'm a bit stuck here. I know that I can use the canvas.toDataURL to produce a base64 encoded string to pass to a classic ASP page on my server. But the problem I can't seem to find an answer to is how to process this data so I can save it someplace on my server.

                因此,使用我的 HTML 頁面上的這段代碼,我提取了畫布數據(我從 StackOverflow 的另一篇文章中提取了這個):

                So with this snippet of code on my HTML page, I pull the canvas data (I pulled this from another post here at StackOverflow):

                var dataURL = renderedCanvas.toDataURL("image/png");    
                dataURL = dataURL.replace('data:image/png;base64,', '');
                
                var areturn = $.ajax({
                  url: "http://127.0.0.1/mySite/saveImage.asp",
                  type: "POST",
                  data: '{ "imageData" : "' + dataURL + '" }',
                  dataType: "json",
                  beforeSend: function(x) {
                      x.overrideMimeType("application/j-son;charset=UTF-8");
                  }
                }).done(function(result) {
                    console.log("Success Done!
                " + result);
                }).always(function(data) {
                    console.log("Always:
                " + data.responseText);
                }); 
                

                但是我現在不清楚一旦我在服務器端如何處理數據......我可以提取 Request.Form 元素,但我似乎找不到任何 base64 解碼的好方法它,甚至將其輸出為二進制文件...我想我聽說經典的 ASP 不擅長進行 base64 解碼,在另一個測試中我確實找到了一個可以進行 base64 解碼的函數,但我不能不知道它是否真的有效,但它確實需要很長時間才能運行.我還在這里找到了這個鏈接:用于 ASP 經典的 base64 圖像解碼器,但我猜這是微軟不推薦使用的 32 位組件……我想我正在向社區尋求有關將 html5 畫布圖像保存到服務器上的建議.

                But I'm unclear now what to do with the data once I'm on the server side... I can pull the Request.Form element, but I can't seem to find a good way to either base64 decode it, or even output it as a binary file... I guess I've heard that classic ASP isn't any good at doing base64 decoding, and in another test I did find a function that did the base64 decode, but I couldn't tell if it really worked, but it did take a long time to run. I also found this link here: base64 image decoder for ASP classic, but I guess this is a 32bit component that Microsoft doesn't recommend using... I guess I'm looking to the community here for suggestions on saving out an html5 canvas image onto the server.

                推薦答案

                您可以使用通過 DomDocument 實例創建的指定 bin.base64 數據類型的 XML 元素來編碼/解碼 Base64 數據.
                然后,您可以使用 Stream 對象將獲得的二進制文件保存到磁盤.
                這兩個庫都支持 64 位.假設您發送的內容將在服務器端的 Request 集合(沒有 json 的經典 post 方法等)中可用,下面的代碼可以解決問題,或者在最壞的情況下,我相信這會給您帶來洞察力.

                You could use an XML element specifying bin.base64 data type that created through a DomDocument instance to encoding / decoding Base64 data.
                Then you can save obtained binary to disk using a Stream object.
                Both of these libraries are 64 bit supported. Assuming the content you sent will be available in a Request collection (classic post methods without json etc.) on the server-side, following code solves the problem or at worst I'm sure that gives you insight.

                saveImage.asp

                Function Base64Data2Stream(sData)
                    Set Base64Data2Stream = Server.CreateObject("Adodb.Stream")
                        Base64Data2Stream.Type = 1 'adTypeBinary
                        Base64Data2Stream.Open
                    With Server.CreateObject("MSXML2.DomDocument.6.0").createElement("b64")
                        .dataType = "bin.base64"
                        .text = sData
                        Base64Data2Stream.Write .nodeTypedValue 'write bytes of decoded base64 to stream
                        Base64Data2Stream.Position = 0
                    End With
                End Function
                
                Dim CanvasStream
                Set CanvasStream = Base64Data2Stream(Request.Form("imageData"))
                
                'Write binary to Response Stream
                'Response.BinaryWrite CanvasStream.Read
                
                'Write binary to File
                CanvasStream.SaveToFile Server.Mappath("imgFileFromCanvas.png"), 2 'adSaveCreateOverWrite
                

                這篇關于如何使用經典 ASP 保存畫布圖像?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                    <tbody id='FonZC'></tbody>
                  <tfoot id='FonZC'></tfoot>
                  <legend id='FonZC'><style id='FonZC'><dir id='FonZC'><q id='FonZC'></q></dir></style></legend>
                    <bdo id='FonZC'></bdo><ul id='FonZC'></ul>

                      <small id='FonZC'></small><noframes id='FonZC'>

                      • <i id='FonZC'><tr id='FonZC'><dt id='FonZC'><q id='FonZC'><span id='FonZC'><b id='FonZC'><form id='FonZC'><ins id='FonZC'></ins><ul id='FonZC'></ul><sub id='FonZC'></sub></form><legend id='FonZC'></legend><bdo id='FonZC'><pre id='FonZC'><center id='FonZC'></center></pre></bdo></b><th id='FonZC'></th></span></q></dt></tr></i><div class="bjd5f77" id='FonZC'><tfoot id='FonZC'></tfoot><dl id='FonZC'><fieldset id='FonZC'></fieldset></dl></div>
                        • 主站蜘蛛池模板: 数显恒温培养摇床-卧式/台式恒温培养摇床|朗越仪器 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 颗粒机,颗粒机组,木屑颗粒机-济南劲能机械有限公司 | NM-02立式吸污机_ZHCS-02软轴刷_二合一吸刷软轴刷-厦门地坤科技有限公司 | 郑州巴特熔体泵有限公司专业的熔体泵,熔体齿轮泵与换网器生产厂家 | 洁净化验室净化工程_成都实验室装修设计施工_四川华锐净化公司 | 机床主轴维修|刀塔维修|C轴维修-常州翔高精密机械有限公司 | 长沙中央空调维修,中央空调清洗维保,空气能热水工程,价格,公司就找维小保-湖南维小保环保科技有限公司 | 重庆小面培训_重庆小面技术培训学习班哪家好【终身免费复学】 | 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 | 顺景erp系统_erp软件_erp软件系统_企业erp管理系统-广东顺景软件科技有限公司 | 东莞画册设计_logo/vi设计_品牌包装设计 - 华略品牌设计公司 | 大通天成企业资质代办_承装修试电力设施许可证_增值电信业务经营许可证_无人机运营合格证_广播电视节目制作许可证 | ptc_浴霸_大巴_干衣机_呼吸机_毛巾架_电动车加热器-上海帕克 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂_帽子厂_浙江高普制帽厂 | 工业冷却塔维修厂家_方形不锈钢工业凉水塔维修改造方案-广东康明节能空调有限公司 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 安徽净化工程设计_无尘净化车间工程_合肥净化实验室_安徽创世环境科技有限公司 | 废气处理_废气处理设备_工业废气处理_江苏龙泰环保设备制造有限公司 | 釜溪印象网络 - Powered by Discuz! | 智慧物联网行业一站式解决方案提供商-北京东成基业 | 液晶拼接屏厂家_拼接屏品牌_拼接屏价格_监控大屏—北京维康 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 石膏基自流平砂浆厂家-高强石膏基保温隔声自流平-轻质抹灰石膏粉砂浆批发-永康市汇利建设有限公司 | 高速混合机_锂电混合机_VC高效混合机-无锡鑫海干燥粉体设备有限公司 | 桨叶搅拌机_螺旋挤压/方盒旋切造粒机厂家-无锡市鸿诚输送机械有限公司 | 工装定制/做厂家/公司_工装订做/制价格/费用-北京圣达信工装 | 深圳市万色印象美业有限公司 | 交联度测试仪-湿漏电流测试仪-双85恒温恒湿试验箱-常州市科迈实验仪器有限公司 | 伺服电机维修、驱动器维修「安川|三菱|松下」伺服维修公司-深圳华创益 | 哔咔漫画网页版在线_下载入口访问指引 | 帽子厂家_帽子工厂_帽子定做_义乌帽厂_帽厂_制帽厂 | 食品机械专用传感器-落料放大器-低价接近开关-菲德自控技术(天津)有限公司 | 上海皓越真空设备有限公司官网-真空炉-真空热压烧结炉-sps放电等离子烧结炉 | 齿轮减速马达一体式_蜗轮蜗杆减速机配电机-德国BOSERL齿轮减速电动机生产厂家 | 超声波清洗机_大型超声波清洗机_工业超声波清洗设备-洁盟清洗设备 | 自恢复保险丝_贴片保险丝_力特保险丝_Littelfuse_可恢复保险丝供应商-秦晋电子 | 手机存放柜,超市储物柜,电子储物柜,自动寄存柜,行李寄存柜,自动存包柜,条码存包柜-上海天琪实业有限公司 | 沈阳网站建设_沈阳网站制作_沈阳网页设计-做网站就找示剑新零售 沈阳缠绕膜价格_沈阳拉伸膜厂家_沈阳缠绕膜厂家直销 | 亿诺千企网-企业核心产品贸易 | 西安展台设计搭建_西安活动策划公司_西安会议会场布置_西安展厅设计西安旭阳展览展示 |