HomePage Forums Plugins Support Drop Uploader – JS Version AJAX Upload – Getting more information after finished

Topic Resolution: Resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Jamey 2 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #710

    Hi,

    I bought this plugin about a month ago and it has been great. Works awesome. I have one question though.

    Is there a way to capture the JSON object that is returned in the ajax_upload.php file?

    I updated the ajax_upload.php file in order to get more information about the uploaded content. For example: image width, image height, filesize, etc… I uploaded this info to a database and I added all this extra data to the $response object that is echoed at the end of the file.

    Now, is there a way to capture that information in JavaScript? When I create my own AJAX functions, there is usually a ‘success’ option I can use to pull and manipulate whatever info is sent back from the AJAX call. Is there a way to do that with this plugin?

    I tried using the file_upload_end function you mentioned in your documents, but the only data I seem able to pull from that function is the file’s name. Not the other data I was able to acquire in the ajax_upload.php file.

    Thanks,

    #711

    Hi!
    Probably you can. In ajax_upload.php you can find $response variable (array). You can add new elements to it and they will be available in response after AJAX request.

    #757

    Hello again! Thanks so much for the response. I found the $response variable in ajax_upload.php and was able to add the new elements I needed. So that part I was able to complete.

    I am unsure however, how to capture that information in the JavaScript file. You wrote in your response: “they will be available in response after AJAX request”, but I am unsure how to pull that info using JS/jQuery. Do I write a new function? Do I use the provided “file_upload_end” function? Any help would be appreciated. Thanks again.

    #758

    Me again….

    Sorry, please disregard my last reply. Minutes after I pushed “send”, I figured out the answer. Thanks again for all your help.

    Jamey

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.