Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

JavaScript
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 }
    });


C#
[HttpPost]
        [Route("api/student/uploads")]
        public async Task<object> UploadDoc(int StudentNumber)
        { 
        // needs to come here
        }
Posted
Updated 25-Oct-18 23:25pm

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900