Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:20:54+00:00 2026-05-25T16:20:54+00:00

I am using an upload script that runs a function once the file is

  • 0

I am using an upload script that runs a function once the file is uploaded. I need this function to re-assign the value of a javascript variable. I need to re-assign “trackid” to the value that is inside my onComplete function. Can anyone help me out?

Edit: A little more explanation… I have 2 instances of this upload script on my page. I need to take the response from the first uploader and assign it as a URL parameter to the 2nd uploader. Does it have something to do with the document.ready? I will update my code.

1st script:

<script type="text/javascript">
trackid = 9999999;
</script>
<script type="text/javascript">
        jQuery(document).ready(function() { 

    $('#mainftp').uploadify({
    'uploader'  : 'js/uploadifyposted/uploadify.swf',
    'script'    : 'js/uploadifyposted/uploadify.php?<?php echo urlencode("privateFolderWav=" . $privateFolderWav . "&userid=" . $userid. "&songid=" . $songid);?>',
    'multi'         : true,
    'auto'          : true,
    'height'        :   '32', //height of your browse button file
    'width'         :   '250', //width of your browse button file
    'sizeLimit' :   '51200000',  //remove this to set no limit on upload size
    'simUploadLimit' : '3', //remove this to set no limit on simultaneous uploads
    'buttonImg' : 'img/browse.png',
    'cancelImg' : 'img/cancel.png',
        'folder'    : '<?php echo $privateFolderWav;?>', //folder to save uploads to
        onProgress: function() {
          $('#loader').show();
        },
        onComplete: function(event, queueID, fileObj, response, data, trackid) {
          $('#loader').hide();
          $('#allfiles').load(location.href+" #allfiles>*","");
          $('#filesUploaded').attr('value', ''+response+'');
          trackid = response;
          alert(trackid);

          //location.reload(); //uncomment this line if youw ant to refresh the whole page instead of just the #allfiles div
        }   
    });

    $('ul li:odd').addClass('odd');

}); 

</script>

2nd script:

<script type="text/javascript">


        jQuery(document).ready(function() { 

    $('#mainftp2').uploadify({
    'uploader'  : 'js/uploadifymultiple/uploadify.swf',
    'script'    : 'js/uploadifymultiple/uploadify.php?<?php echo urlencode("songid=" . $songid . "&userid=" . $userid . "&trackid=");?>'+trackid,
    'multi'         : true,
    'auto'          : true,
    'height'        :   '32', //height of your browse button file
    'width'         :   '250', //width of your browse button file
    'sizeLimit' :   '51200000',  //remove this to set no limit on upload size
    'simUploadLimit' : '3', //remove this to set no limit on simultaneous uploads
    'buttonImg' : 'img/browse.png',
    'cancelImg' : 'img/cancel.png',
        'folder'    : '<?php echo $multiFolder?>', //folder to save uploads to
        onProgress: function() {
          $('#loader2').show();
        },
        onComplete: function(event, queueID, fileObj, response, data) {
          $('#loader2').hide();
          $('#allfiles2').load(location.href+" #allfiles2>*","");
          $('#filesUploaded2').attr('value', ''+response+'');

          //location.reload(); //uncomment this line if youw ant to refresh the whole page instead of just the #allfiles div
        }   
    });

    $('ul li:odd').addClass('odd');

}); 

</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:20:55+00:00Added an answer on May 25, 2026 at 4:20 pm

    I’m not seeing a trigger in this code. It looks like both scripts run immediately once the page is loaded, if so, the second script isn’t waiting for the variable reassignment. You should have that second function called in the onComplete of the first

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ajax file upload function with its javascript / jQuery library . When
I have a standard file upload script using this script. When the upload is
I have a flash upload script, that uses a .php file as the processor.
I have written a pretty basic upload script that takes the file and uploads
I have a question. I have a script that handles file upload, and after
Well I know that selenium world is full of file upload threads, and this
I need to upload images using FileUpload without postback(using Ajax).I tried many examples.But in
When I upload a file to a site using the ASP:File control the FileName
How would I upload a file to a webserver using c++ and MFC. We
in my python program to upload a file to the internet, im using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.