Results 1 to 10 of 10

Thread: Multiple file upload AJAX

  1. #1
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Multiple file upload AJAX

    Hi,

    I need a multiple file upload AJAX component. The requirement is each file should able to be uploaded individually with a individual submit button.

    Also individual progress bar should be there. I am ready to go ahead with any suggested javascript frameworks.

    Please let me know at the earliest. Let me know if you are expecting any more inputs from me.

    Thanks in Advance for your time and attention.

  2. #2
    Join Date
    Jan 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi, Can anyone help me on this. Thanks in advance

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    This should work:
    Code:
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    
    <script type="text/javascript">
    function example_ajax_request(page){
      $('#example-placeholder').html('<p><img src="http://www.electrictoolbox.com/images/ajax-loader.gif" width="220" height="19" /></p>');
      setTimeout(function(){example_ajax_request_go(page);}, 500);
    }
    function example_ajax_request_go(page){
      $('#example-placeholder').load(page);
    }
    </script>
    
    </head>
    
    <body>
    <div>
    <a href="javascript:void(0)" onclick="example_ajax_request('external1.html');">External 1</a><br>
    <a href="javascript:void(0)" onclick="example_ajax_request('external2.html');">External 2</a><br>
    
    <div id="example-placeholder"><a>External file will appear here</a></div>
    
    </div>
    </body>
    Replace the external files with existing ones.
    ===
    Arie Molendijk

  4. #4
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    molendijk, can you explain all parts of this script? which line what thing does?

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    The online jquery script on top is the library you need.
    With the function example_ajax_request(page) you can include external files by doing something like onclick="example_ajax_request('some_external_page.html');"
    The function example_ajax_request_go(page) together with the line containg the loader gif take care of the progress bar.
    The div with the placeholder indicates the location of the external file.
    ===
    Arie.

  6. #6
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    so if I will write in some_external_page.html line "hello", in div I will see it?

  7. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

  8. #8
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    and everything will work without refreshing the page?

  9. #9
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    also, offtopic thing

    I want to create image which is grey normally, but when someone puts his mouse on it, he will became blue and finishes in 3 seconds... I think it has something in common with
    PHP Code:
    $("div").fadeOut(3000); 
    But I don't know what function to use, .click() is not good for this.

  10. #10
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Auriaks, yes, everything without refreshing the page.
    As for the image, I suggest to google around.
    ===
    Arie.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •