Fine-uploader endpointer拒绝进入api控制器 [英] Fine-uploader endpointer refuses to go to api controller

查看:100
本文介绍了Fine-uploader endpointer拒绝进入api控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了精细上传器的终点问题,它拒绝攻击api控制器。拖放后,它直接转到onSubmitted但不使用终点。请帮助我找不到的东西。



我尝试过:



I am having issues with the end point of fine uploader, it refuses to hit the api controller. After drag and drop it goes straight to onSubmitted but does not use end point. Please assist what am I missing.

What I have tried:

var galleryUploader = new qq.FineUploader({
        element: document.getElementById("fine-uploader-gallery"),
        template: 'qq-template-gallery',
        autoUpload: false,
        request: {
            endpoint: '/api/student/uploads/',
            params: {
                StudentNumber: StudentNumber
            }
        },
        thumbnails: {
            placeholders: {
                waitingPath: '/node_modules/fine-uploader/fine-uploader/placeholders/waiting-generic.png',
                notAvailablePath: '/node_modules/fine-uploader/fine-uploader/placeholders/not_available-generic.png'
            }
        },
        validation: {
            itemLimit: 2,
            allowedExtensions: ['jpeg', 'jpg', 'gif', 'png','pdf']
        },
        uploadSuccess: {



        },
        callbacks: {
            onSubmitted: function (id, name) {
                debugger;

            },
            onError: function (id, name, errorReason, xhrOrXdr) {
                debugger;

            },
            onUpload: function (id, name, isError, responseJSON) {
                debugger;

            },
            onComplete: function (id, fileId, responseJSON) {
                debugger;

            }
        },
        retry: { enableAuto: false }
    });







[HttpPost]
        [Route("api/student/uploads")]
        public async Task<object> UploadDoc(int StudentNumber)
        { 
        // needs to come here
        }

推荐答案

因为你提交了它会发送到onSubmitted要上传的文件。



活动|精细上传文档 [ ^ ]



如果没有达到你的终点,那么问题可能就是其他问题。也许您在端点地址上有斜杠?检查浏览器工具的网络选项卡是否有任何连接到终点的尝试,这将显示网络错误。如果根本没有尝试连接到终点,则问题可能在其他地方。
It is going to onSubmitted because you have submitted the file to be uploaded.

Events | Fine Uploader Documentation[^]

If it's not hitting your endpoint then the issue is probably something else. Maybe the trailing slash you have on the endpoint address? Check the network tab of the browser tools for any attempt to connect to the end point, that will show you network errors. If there is no attempt at all to connect to the end point then the issue is probably elsewhere.


这篇关于Fine-uploader endpointer拒绝进入api控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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