Is this possible?

Last post 02-20-2009, 2:37 PM by ttucker. 2 replies.
Sort Posts: Previous Next
  •  02-06-2009, 3:41 PM 48457

    Is this possible?

    Hello,
     
    We are considering using AjaxUpload for our project, but it has some specific requirements that need to be met and I'd like to know if they are possible to accomplish.  If anyone has any ideas on how to accomplish this using AjaxUpload, it would be much appreciated.
     
    What we have is a form where a user is presented with a list of assignments they are currently assigned.  Next to each assignment's title is a browse box where the user can select the video file for that assignment.   As soon as one file is selected for upload, it should start uploading, but if the user has selected the files for several assignments, they should upload one at a time, not concurrently.  When a file is uploading, it should have its own progress bar and the user should be able to see whether a file was uploaded successfully or not. If the user's internet connection dies, the application should automatically retry every couple minutes until the connection is restored.  When the connection is restored, the upload should continue automatically, but the user can also click a button to force it to start uploading again so they don't have to wait for the next retry.  If a file was uploading when the connection dropped, the application does not need to resume progress on that file, it just needs to be marked as not uploaded so the application can go back to it and upload it again once the rest of the files are complete.  It should also be able to handle large files, since these are going to be HD videos.  Also, the titles of the assignments need to be associated with the upload file at some point in the process, so we need some kind of post data to go along with the file uploads.
     
    Here is a screenshot of what the application will look like, more or less:
     

     
    Out of the box I know AjaxUpload probably can't do all of this, but I imagine with fancy Javascript code and manipulation of the AjaxUpload API, we can get close.  I'm not asking anyone to code this all out for us (though that would be great :)), I just want to know if you think we can do it and if you have any suggestions on how to get there.
     
    Thanks in advance,
    Anthony
  •  02-06-2009, 4:21 PM 48459 in reply to 48457

    Re: Is this possible?

    Anthony,
     
    Uploader provide JavaScript API to let you listen the event.
     
     
    OnSelect - to know files have been added into queue.
     
    OnQueueUI - to get the files information.
     
    OnProgress - to get the progress information.
     
    OnPostback - to know the file is uploaded, and prepair to fire the server event. you can return false to cancel it, and do the postback later.
     
    And you may use the ManualStartUpload property to control when it should start file transfering.
     
    You need use all these things and write a lot of JavaScript code to implement your request.
     
    Regards,
    Terry
     
     
  •  02-20-2009, 2:37 PM 49062 in reply to 48459

    Re: Is this possible?

    Terry,
     
    Thanks a lot. I'm coding out the solution above and almost have it perfect. What I'm trying to complete at this point is a file-level resume based on the file upload status.
     
    If I'm using the handler like this:
     
    myupload1.handleprogress=function(enable,filename,begintime,uploadedsize,totalsize){   
    if(enable)    {      
    if(totalsize)       {        
    x = 1;        
    y+=1;                 
    document.title=filename+" - "+Math.floo(100*uploadedsize/totalsize)+'%'
     
    as is listed in one of your examples, how can I get the file status? I can't pass files after the totalsize variable to the function, and I need to know the status ongoing to check for errors if there is a connection interruption. Can you be of assistance?

    ~ Thomas
View as RSS news feed in XML