This is a migrated thread and some comments may be shown as answers.

radupload files count equal 0

2 Answers 115 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mona
Top achievements
Rank 1
Mona asked on 19 Oct 2008, 12:56 PM
Hi folks ;
Iam facing a problem in saving files used to uplaod by RadUpload
everytime while saving alwayes get 0 files count although I attached files to it
can you help me discover where is the problem ...?

attached radUploader tags

<
telerik:RadUpload ID="RUAttach" runat="server" Skin="Web20" TargetFolder="Attachment"

 

 

Width="100%" />

 

 

 

&nbsp;<telerik:RadProgressManager ID="RadProgressManager1" runat="server" />

 

 

<telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="True"

 

 

ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed"

 

 

Skin="Web20">

 

 

</telerik:RadProgressArea>

and this is the method used to save attachments :

 

 

RadUploadContext uploadContext = RadUploadContext.Current;

 

 

foreach (UploadedFile file in RUAttach.UploadedFiles)

 

{

 

if (file != null)

 

{

file.SaveAs(Server.MapPath(

"~/MyFiles/" + file.GetName()));

 

}

}


the count files =0 in ( RUAttach.UploadedFiles)

thanks in advance
Mona

2 Answers, 1 is accepted

Sort by
0
Mona
Top achievements
Rank 1
answered on 30 Oct 2008, 04:42 PM
Dear Telerik Team ;
didn't hear from you . is my problem wierd enough that makes no one answer !
0
Veselin Vasilev
Telerik team
answered on 30 Oct 2008, 04:50 PM
Hi Mona ,

Actually, when you set the TargetFolder, you do not need to save the files manually using the SaveAs method. The files will be uploaded to the target folder on the first postback automatically.
 

Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Upload (Obsolete)
Asked by
Mona
Top achievements
Rank 1
Answers by
Mona
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or