commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Salman Khattak <khatta...@yahoo.com>
Subject Re: [fileupload] - aborting file upload
Date Tue, 08 May 2007 18:04:05 GMT

David,
Here are some links I researched to do fileupload monitoring.
http://del.icio.us/khattak/fileupload

The status jsp has the following code snippet:
<c:if test="${sessionScope.FILE_UPLOAD_STATS.currentStatus == 'error'}">
	<div id="abortdiv" onclick="javascript:refresh();" style="background-color:
red; width: 450px; height: 20px; text-align: center; cursor: pointer">
		ERROR!<br/>CLICK HERE TO ABORT UPLOAD
	</div>
</c:if>

The 'parent' page is monitoring the upload in a 'status' div - the contents
of which are generated by the status jsp - relevant parent page snippet:

  var updater = null;
  function startStatusCheck()  {
    updater = new Ajax.PeriodicalUpdater(
                               
'status','${pageContext.request.contextPath}/UploadStatus.do',
                                {asynchronous:true, frequency:1, method:
'get', parameters: 'c=status', onFailure: reportError, decay: 2});
    return true;
  }


The refresh function is in the parent page and is as follows:
  function refresh() {
	window.location.reload();
  }

All this will make more sense if you go through the file upload monitoring
solutions found in the links I have posted above. This using Prototype Ajax.

HTH

Salman Khattak


david2 wrote:
> 
> Salman,
> 
> But what Jakarta Commons HttpClient API do you invoke to abort the upload
> and force the connection to close?
> 
> -David
> 
> 

-- 
View this message in context: http://www.nabble.com/-fileupload----aborting-file-upload-tf2640397.html#a10380758
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message