本文介绍了使用ajax&amp ;;上传文件戏剧性的IIS,我在IIS上缺少什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好



我正在上传文件,起初我正在使用fineuploader,然后改为简单的ajax。我得到的错误类似于xhr:Web应用程序抛出了未处理的异常。现在这可以在本地工作,但在服务器上不起作用,我在IIS配置中缺少什么?请帮助。



我尝试过:



//以下是JS



Hi Guys

Im doing a file upload, at first i was using fineuploader, then changed to simple ajax. The error i get is similar the "xhr:An unhandled exception was thrown by the Web Application." Now this works locally but doesn't work on the server, what am I missing on IIS configs? Kindly assist.

What I have tried:

//Below is the JS

var formData = new FormData();
        var file = $('#fileID')[0];

        formData.append('file', file.files[0]);
        $.ajax({
            url: '/api/document/uploads/',
            type: 'POST',
            data: formData,
            contentType: false,
            processData: false,
            success: function (result) {

            },
            error: function (result) {

            }
        });





//以下是api



//Below is the api

[HttpPost]
[Route("api/document/uploads")]
public async Task<object> UploadDoc()
{
}

推荐答案






//以下是api



//Below is the api

[HttpPost]
[Route("api/document/uploads")]
public async Task<object> UploadDoc()
{
}


这篇关于使用ajax&amp ;;上传文件戏剧性的IIS,我在IIS上缺少什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 02:56