Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts

    File Uploading Problems

    I am trying to clean up my AJAX file uploading code and am having the following problem...

    The PHP code that does the actual upload, creates the new file, and massages and resizes the final file all works great. The problem is the little piece of javascript code that is attempting to monitor the status of the process. The files I am uploading are relatively small, so a status bar is not really the issue. Right now I am uploading pictures, so the issue is getting the resulting picture to display in the IMG field properly.

    In the code that is waiting for the upload to finish, the http.open call is made with a onreadystatechange = GetStatus. The first upload I do, http.readyState goes from 1 to 4 as expected. When it hits 4, I do my IMG refresh and all is fine. The problem is any subsequent calls don't seem to work. The onreadystatechange seems to continually get called (though the readyState says 4, the clearInterval doesn't seem to work, and the code to refresh never gets updated.

    Any clues?
    Last edited by snoodle; 07-12-2007 at 05:16 AM. Reason: typo-s

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    check out my post here:

    AJAX function only works once!

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts
    wow... thanks alien. it worked!


  •  

    Posting Permissions

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