Skip to content

Adapt to use function to call processing rather than upload immediately after choosing file(s) #36

Description

@VitoAsaro

First of all, thanks for this function; it's excellent!
I've been trying to implement this as part of another function, so I'm not using it as part of the jquery document ready:

$(document).ready(function(){
$('input[type="file"]').ajaxfileupload({
'action': 'uploadfile.cfm'
});

I'm attempting to call it from another function that is called by a button on my form:
<input type="button" name="btnAction" id="btnAction" value="UPDATE RECORD" onClick="recordAddUpdate(this.form);" >

within the function recordAddUpdate(theForm) to call the ajaxfileupload I have:
...
$('#uploadImage').ajaxfileupload({
'action': 'bsl-editor/bslupload.cfm',
'submit_button': $('#btnAction')
});
...

This works, but only after the "UPDATE RECORD" button is pressed twice
I see in your javascript that the first time the function processes, nothing occurs because it's processing the "ajaxUploader-setup" as true and initializing.
How can I have it both set up (initialize) and process with only a single call to the function?

Thanks!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions