Hi,
The images are only saved in the temp folder. On btnSave click I only get the message 'select images'. The code is copied from the example. Am I overlooking something?
ASPX Code:
- <asp:UpdatePanel ID="udpImages" runat="server" UpdateMode="Conditional">
- <ContentTemplate>
- <cc2:UploadAttachments ID="uplImages" OnFileUploaded="uplImages_FileUploaded" runat="server"
- TempDirectory="~/Library/temp_upload" MaxFilesLimit="5" FileTooLargeMsg="Bestand is te groot! Max. 1 MB."
- MultipleFilesUpload="true" ShowProgressInfo="false" ShowProgressBar="false" InsertText="Kies uw afbeeldingen"
- MaxFilesLimitMsg="U mag maximaal 5 afbeeldingen uploaden" RemoveButtonText="Verwijder"
- ShowFileIcons="true">
- <ValidateOption MaxSizeKB="1000" AllowedFileExtensions="jpg,png,gif,jpeg,bmp" />
- </cc2:UploadAttachments>
- </ContentTemplate>
- </asp:UpdatePanel>
- <asp:Button runat="server" ID="btnSave" onclick="btnSave_Click" Text="Bewaren" OnClientClick="return submitbutton_click()" />
Javascript code:
- <script type="text/javascript">
-
- function submitbutton_click() {
- var submitbutton = document.getElementById('<%=btnSave.ClientID %>');
- var uploadobj = document.getElementById('<%=uplImages.ClientID %>');
- if (!window.filesuploaded) {
- if (uploadobj.getqueuecount() > 0) {
-
- uploadobj.startupload();
- }
- else {
- var uploadedcount = parseInt(submitbutton.getAttribute("itemcount")) || 0;
- if (uploadedcount > 0) {
- return true;
- }
- alert("Select images");
- }
- return false;
- }
- window.filesuploaded = false;
- return true;
- }
-
-
- </script>
C# code:
- int uploadcount = 0;
-
- protected override void OnPreRender(EventArgs e)
- {
- btnSave.Attributes["itemcount"] = uplImages.Items.Count.ToString();
-
- base.OnPreRender(e);
- }
-
- public void uplImages_FileUploaded(object sender, UploaderEventArgs args)
- {
-
- uploadcount++;
- Uploader uploader = (Uploader)sender;
-
-
-
- }
-
- public void btnSave_Click(object sender, EventArgs e)
- {
- }