//Copys the uploaded file to a new location.
//args.CopyTo(path);
//You can also open the uploaded file's data stream.
//System.IO.Stream data = args.OpenStream();
}
void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { linkAddInfoAdd.Attributes.Add("onmouseover", "this.style.cursor='hand'"); Uploader1.SetAdvancedOption(UploaderAdvancedOption.NoFlash, "true"); } } </script>
<html xmlns="
http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Start uploading manually</title>
<link rel="stylesheet" href="demo.css" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="content">
<h2>
Start uploading manually</h2>
<p>
This sample demonstrates how to start uploading manually after file selection vs
automatically.</p>
<asp:LinkButton ID="linkAddInfoAdd" runat="server">Add</asp:LinkButton>
<CuteWebUI:UploadAttachments runat="server" ID="Uploader1" ShowProgressBar="true"
InsertButtonID="linkAddInfoAdd" ProgressCtrlID="Uploader1Progress" ProgressTextID="Uploader1ProgressText"
TempDirectory="C:\temp\">
<ValidateOption MaxSizeKB="6100" AllowedFileExtensions="EPS" />
</CuteWebUI:UploadAttachments>
<br />
<br />
<asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()"
Text="Submit" OnClick="SubmitButton_Click" />
<br />
<br />
<div>
<asp:ListBox runat="server" ID="ListBoxEvents" Width="400"></asp:ListBox>
</div>
<script type="text/javascript">
function submitbutton_click() {
var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');
var uploadobj = document.getElementById('<%=Uploader1.ClientID %>');
if (!window.filesuploaded) {
if (uploadobj.getqueuecount() > 0) {
uploadobj.startupload();
}
else {
var uploadedcount = parseInt(submitbutton.getAttribute("itemcount")) || 0;
if (uploadedcount > 0) {
return true;
}
alert("Please browse files for upload");
}
return false;
}
window.filesuploaded = false;
return true;
}
function CuteWebUI_AjaxUploader_OnPostback() {
window.filesuploaded = true;
var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');
submitbutton.click();
return false;
}
</script>
</div>
</form>
</body>
</html>