【问题标题】:how to upload picture in asp.net using jquery and save it in folder如何使用jquery在asp.net中上传图片并将其保存在文件夹中
【发布时间】:2013-05-30 15:39:59
【问题描述】:

我正在尝试使用 jquery 对话框上传图像并将其保存在服务器文件夹“images”中并将图像路径发送到数据库。

这是我在 asp 中的文件上传控件,显示在 jquery 对话框 ui 上

<asp:FileUpload ID="upl_Photo" runat="server" />

当我单击对话框按钮上的“确定”按钮时,我需要将图像保存在“图像”文件夹中。

$(function () {
$(".dialog_Items").dialog({
    autoOpen: false,
    width: 500,
    height: 400,
    modal: true,
    show: 'fade',
    buttons: {
        'Add': function () {
           //save image in a server folder

            $.ajax({
                //send saved image path 

            });

            $(this).dialog('close');

        },
        'Cancel': function () {
            $(this).dialog('close');
        }
    },
    open: function (event) {
        $('.ui-dialog-buttonpane').find('button:contains("Add")').addClass('addButton');
        $('.ui-dialog-buttonpane').find('button:contains("Cancel")').addClass('cancelButton');
    }
});

$("#btn_Items").click(function (event) {
    event.preventDefault();
    $(".dialog_Items").dialog("open");
});

});

【问题讨论】:

    标签: jquery asp.net jquery-ui-dialog


    【解决方案1】:

    您可以使用 ASP.Net 文件上传控件上传多个文件....使用 ajax UpdatePAnel....一旦发布到服务器,将文件保存到磁盘并复制路径就不会那么麻烦了....

    否则你可以使用uploadify - http://www.uploadify.com/

    【讨论】:

      猜你喜欢
      • 2014-02-19
      • 1970-01-01
      • 1970-01-01
      • 2017-12-25
      • 1970-01-01
      • 2018-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多