file delete issues

Last post 08-27-2009, 12:15 PM by pmehta1. 2 replies.
Sort Posts: Previous Next
  •  08-27-2009, 9:55 AM 55104

    file delete issues

    Hi,
    In the UploaderEventHandler, I am setting the temp path before uploading the files,
    void Uploader_FileUploaded(object sender, UploaderEventArgs args)
        {
            using (System.IO.Stream stream = args.OpenStream())
            {
                string path = "D:\\UploadedFiles\\";
                Attachments1.TempDirectory = path;
                Attachments1.Upload(args.FileSize, args.FileName, stream);
            }
    }
    This works fine. But when I try to delete the files, it does not delete it from the disk. The 'Attachements1' does not retain its items. Also, the inbuilt 'Remove' feature doesn't delete the files from disk.
     
    protected void ButtonDeleteAll_clicked(object sender, EventArgs e)
        {
            Attachments1.DeleteAllAttachments();
        }
     
    How can I make delete and remove work in this case?
     
    Thanks,
  •  08-27-2009, 10:32 AM 55107 in reply to 55104

    Re: file delete issues

    Hi,
     
    For security reason , uploader will not persist the TempDirectory.
     
    You should set the Attachments1.TempDirectory = path; every times the page init.
     
    Regards,
    Terry
  •  08-27-2009, 12:15 PM 55118 in reply to 55107

    Re: file delete issues

    Thanks Terry. That worked great.
View as RSS news feed in XML