如何通过javascript保存文件? [英] How can save a file through javascript?

查看:85
本文介绍了如何通过javascript保存文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有浏览和保存按钮的TEXTBOX。我可以浏览文件,但不能将文件保存在文件夹中这是紧急的plz帮助。

解决方案

undering i提供此类问题的完整代码







 <  !doctype     html  >  
< head >
< meta charset = utf-8 >
< style < span class =code-keyword>> a {font:12px Arial;颜色:#ac9095; } < / style >
< / head >
< / body >
< 表格 >
< label > ; Nome < / label > < 输入 < span class =code-attribute> type = text name = nome > < br / > ;
< label > Cognome < / label > ; < 输入 type = text 名称 = cognome
>
< 按钮 type = 按钮 id = salva > Salva < / button >
< / form > ;

< textarea rows = 10 cols = 60 > < / textarea > < ; br / < span class =code-keyword>>
< 按钮 type = button id = esporta > Esporta dati < / button >
< a href = 样式 = display:none > Scarica Dati < / a >
< / body >
< / html >



BackEnd代码



var f =

('form'),a =


('a'),
i =


I have a TEXTBOX with BROWSE and SAVE button.I could browse the file but not save the file in folder this is urgent plz help.

解决方案

belowing i provide complete code of such Question



<!doctype html>
<head>
    <meta charset="utf-8">
    <style>a { font: 12px Arial; color: #ac9095; }</style>
</head>
</body>
    <form>
        <label>Nome</label> <input type="text" name="nome"><br />
        <label>Cognome</label> <input type="text" name="cognome">
        <button type="button" id="salva">Salva</button>
    </form>

    <textarea rows="10" cols="60"></textarea><br />
    <button type="button" id="esporta">Esporta dati</button>
    <a href="" style="display: none">Scarica Dati</a>
</body>
</html>



BackEnd Code



var f =


('form'), a =


('a'), i =


这篇关于如何通过javascript保存文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆