TempDirectory not working properly

Last post 11-16-2011, 10:13 PM by shahromil88. 2 replies.
Sort Posts: Previous Next
  •  11-15-2011, 10:32 PM 71393

    TempDirectory not working properly

    I am using AjaxUploader control. I want to use TempDirectory property. Below is the source code for that :
     
    <CuteWebUI:UploadPersistedFile runat="server" ID="PersistedFile1" InsertText="Upload File"   TempDirectory="~/temp"
                            OnFileChanged="PersistedFile_FileUploaded">
                        </CuteWebUI:UploadPersistedFile>
     
    When i am going to upload excel file, the file moves to specified location but its saving file as "persisted.9e86680a-bbf4-407d-a473-cb05689076d2.Coding Standards.xls.resx"  resource file. I am not getting why this is happening. Please give me solution if any.
     
    Filed under:
  •  11-16-2011, 3:14 AM 71396 in reply to 71393

    Re: TempDirectory not working properly

    Dear shahromil88,
     
     The *.resx file under temp folder is temp file AjaxUploder uses, 
    You need to use method below to copy or move the attachment to saving folder.
    1. void Uploader_FileUploaded(object sender, UploaderEventArgs args)  
    2.     {  
    3.         //Copys the uploaded file to a new location.  
    4.         args.CopyTo("c:\\temp\\"+args.FileName);  
    5.         //args.MoveTo("c:\\temp\\"+ Path.GetExtension(args.FileName)  
    6.     } 
     
     
    Regards,
    Jeff
  •  11-16-2011, 10:13 PM 71434 in reply to 71396

    Re: TempDirectory not working properly

    Thank you very much Jeff. It is working now.
View as RSS news feed in XML