file download progress

Discussion in 'jQuery' started by stephan2307, Nov 16, 2010.

  1. #1
    Hi,

    I am writing a script which downloads a large file from a given url.

    I would like to display a progress bar to check the progress.

    I have written the code in php and it works like this.

    I enter a url into a form and press a button. This sends a ajax request to a script which will download the file.

    Then I have attached an click event to the button on the form which goes and check how many bytes have been downloaded so far and place it inside a div.

    Now the file download script works but I can't get the progress script to work. For some reason it waits for the first one to finish. Any idea a way around this?


    here is the code I use

    
    	function createFile() {
    		 		var u = $('#url').val().substr(7);
    				
    				$.getScript('<?php echo $site['url'];?>downloadFile.php?url='+escape(u));
    		}
    		
    		function progress() {
    				$.getScript('<?php echo $site['url'];?>downloadFileProgress.php');
    		}
    		
    		$('#fetch').click(function () { progress();})
    	
    
    PHP:
    thanks
     
    stephan2307, Nov 16, 2010 IP
  2. Ankurkr

    Ankurkr Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Thank you very much for sharing these script with me.
    i am looking for it from various days, And it will help me in completion of my project.
     
    Ankurkr, Nov 19, 2010 IP
  3. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #3
    CSM, Nov 26, 2010 IP