Click here to Skip to main content
14,392,692 members
Rate this:
Please Sign up or sign in to vote.
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:

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
        }
Posted
Updated 26-Oct-18 0:25am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100