Setting uploaded files count to synchronize with MaxFilesLimit?

Last post 04-26-2010, 10:44 PM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  04-23-2010, 4:43 PM 60361

    Setting uploaded files count to synchronize with MaxFilesLimit?

    This is the problem I'm having...
     
    MaxFilesLimit for the control is set to 4.
     
    1. I've multi-selected 3 files and it uploads them. There are now 3 files in my TempDirectory.
    2. I run a process that deletes all 3 of those files from TempDirectory.
    3. When I multi-select 3 more files, I get the
    MaxFilesLimitMsg because it thinks I'll be adding 3 more files for a total of 6 files.
     
    How can I update this control counter?
     
    The application I'm working on displays on a datalist the images that the user selected in UploadCompleted. But, through the datalist, the user can also delete the images. I need to be able to synchronize the control counter with the actual files in TempDirectory.
     
    Thanks. 
  •  04-26-2010, 10:44 PM 60429 in reply to 60361

    Re: Setting uploaded files count to synchronize with MaxFilesLimit?

    Hi,
     
    Are you using UploadAttachments?
     
    Maybe you can try this code :
     
    while(uploader1.Items.Count>0)
    {
        uploader1.Items[0].Remove(); 
       //Remove() :  remove it from collection but do not delete the temp file
       //Delete() : remove it from collection and delete the file
    }
     
    Regards,
    Terry
View as RSS news feed in XML