Hello and thanks for your reply.
Maybe I didn't make myself clear. Actually by an invalid file I meant an unacceptable file (a file with extension other than those defined in ValidateOption tag or bigger than MaxSizeKB).
Here is the [trimmed version of] code. To simulate my problem add a file, and then add another file (larger than 512Kb). It will show the error message but will immediately start uploading the files (even though the ManualStart is set to True) (config: IIS7/Win7/IE8)
- <cutewebui:UploadAttachments runat="server" ID="Attachments1" InsertButtonID="btnAdd"
- HideNoItemTable="true" AutoUseSystemTempFolder="False" ManualStartUpload="True"
- TempDirectory="templocation" ShowProgressBar="false" >
- <ValidateOption AllowedFileExtensions="*.jpg, *.gif, *.png, *.bmp" MaxSizeKB="512" />
- </cutewebui:UploadAttachments>
- <div class="uploader" style="width: 700px;">
- <div id="filequeue_div" class="filequeue" style="visibility: collapse;">
- </div>
- <input type="button" id="btnAdd" onclick="return CancelAllTasks();" value="Add File(s)"/>
- <input type="button" id="btnUpload" onclick="return StartUpload()" value="Upload Files" />
- <input type="button" id="btnCancel" onclick="return CancelAllTasks();" value="Cancel Upload" />
- </div>
-
- <script language="javascript" type="text/javascript">
-
- var uploader = document.getElementById('<%= Attachments1.ClientID %>');
- uploader.handlequeueui = QueueUIHandler;
- var btnAdd = 'btnAdd';
- var btnUpload = 'btnUpload';
- var btnCancel = 'btnCancel';
-
- function QueueUIHandler(list) {
-
- if (list.length < 1) {
- var container = document.getElementById('filequeue_div');
- container.innerHTML = '';
- container.style.visibility = 'collapse';
- }
- else {
- var container = document.getElementById('filequeue_div');
- container.style.visibility = 'visible';
- var table = document.getElementById('uplistable');
-
- if (table == null) {
- container.innerHTML = '';
-
- table = document.createElement('table');
- table.id = 'uplistable';
- tablehead = document.createElement('thead');
- var row = tablehead.insertRow(-1);
- row.insertCell(-1).innerHTML = 'Filename';
- table.appendChild(tablehead)
- tablebody = document.createElement('tbody');
-
- for (var i = 0; i < list.length; i++) {
- var name = list[i].FileName
- var row = tablebody.insertRow(-1);
- row.insertCell(-1).innerHTML = name;
- }
- table.appendChild(tablebody);
-
- container.appendChild(table);
- }
- }
- return false;
- }
-
- function CuteWebUI_AjaxUploader_OnPostback() {
- return false;
- }
-
- function CuteWebUI_AjaxUploader_OnStart() {
- alert('started');
-
- }
- </script>