Matthew Friedman
Matthew Friedman

Reputation: 491

Looking for an example on how to use the Initial File List function

I have looked over the doc and searched for forums but I can not seem to find an examples on how to implement the Initial File List functionality for fine-uploader.

Below is the script that I am using - works great but what I would like to do is to use the Initial File List function to populate the fineuploader with the existing files that have been uploaded during this session.

I have code that will return a json feed with the required files in an array format. I just can ot figure out where our how to call the function to initalize.

Thanks in advance.

 <script>
// Wait until the DOM is 'ready'
$(document).ready(function () {
    $("#fine-uploader").fineUploader({
        debug: true,
        request: {
            endpoint: 'upload.cfm'
            },
    session : {
           endpoint: 'imageStatus.cfm',
           refreshOnRequest:true
            },
     validation: {
            itemLimit: 2,
            allowedExtensions: ["jpeg", "jpg", "gif" , "png"],
            sizeLimit: 5000000 // 5 MiB
            },
    messages: {
        tooManyItemsError: 'You can only add 2 images'
            },
        deleteFile: {
            enabled: true, // defaults to false
            endpoint: 'upload_delete.cfm?uuid=',
            method: 'post'
            },
        retry: {
           enableAuto: false
            },
         scaling: {
            sendOriginal: true,
            hideScaled: true,
            sizes: [
                {name: "THUMB_XX", maxSize: 113},
                {name: "FULLIMAGE", maxSize: 450}
                ]
            },
    });
});
</script>

Upvotes: 1

Views: 3360

Answers (2)

Mark Feltner
Mark Feltner

Reputation: 2041

The initial file list feature is not a function that you call, per say, it is an option that you set in the client. More or less, all you need to set is the endpoint where the uploader can retrieve this list of files, and then have your server correctly process them.

The server response should be a JSON Array of Objects.

[{ name: 'foo.jpg', uuid: "7afs-sdf8-sdaf-7asdf" }, ... ]

The trickiest part is getting that list of files server-side, and you may want to ask some Coldfusion folks about how to do that.

Upvotes: 1

Matthew Friedman
Matthew Friedman

Reputation: 491

I solved the issue. ends up that I did a custom build of the JS files and did not include the status function. rebuild the downloads and works like a charm.
thanks everyone for the help.

Upvotes: 2

Related Questions