imageupload在本地工作,但在服务器中不起作用

时间:2015-11-29 12:51:43

标签: ajax vb.net web-services webmethod image-upload

我想在服务器上上传图片。我使用ajax和webmethod,当我在本地主机上运行代码时,它工作,但是当我在服务器上传它时它不起作用。 我想我的网络方法存在一些问题,但我找不到它。

  <body>

<form action="" id="form1" method="post">
  First name:<br>
  <input type="text" name="firstname" value="Mickey">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse">
  <br><br>
  <input type="submit" id="submit1" value="Submit">
</form>

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>


<script>
    // AJAX SEND POST DATA
    $('form').on('submit', function() {
        var self = this;
        $.ajax({
            type: 'post',
            url: 'submit2.php',
            dataType: 'json',
            data: $(self).serialize(),
            success: function() {
                alert("blabla");                    
            }
        });
    });
</script>

0 个答案:

没有答案
相关问题