public void startUpload() { if (upload.getStats().isInProgress()) { return; } numFiles = upload.getStats().getFilesQueued(); totalSize = 0L; bytesUploaded = 0L; for (int i = 0; i < numFiles; i++) { totalSize += upload.getFile(i).getSize(); } updateUrl(); upload.startUpload(); }
private void updateUrl() { final String uploadUrl = GWT.getHostPageBaseURL() + "fileupload;jsessionid=" + session.getSessionId() + "?end=" + totalSize + "&start=" + bytesUploaded + "&clientId=" + clientId + "&lastUpload=" + ((filesUploaded + 1) == numFiles); upload.setUploadURL(uploadUrl); }