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

Silverlight Multi File Uploader

1 Answer 103 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ted Bielenda
Top achievements
Rank 1
Ted Bielenda asked on 28 May 2010, 07:00 AM
Hi,

           I am using Silverlight MultiFile Upload Control For uploading multiple files and also using radupload when silverlight is not install on machine so how i can work both of these and in c# how i can save the file if these both are diffrent.

<

telerik:RadAjaxPanel runat="server" ID="AjaxPanelMain" LoadingPanelID="LoadingExamplePanel" EnableAJAX ="true">

 

 

<asp:Panel runat="server" ID="Panel1" Visible="true">

 

 

<input type="hidden" id="UploadedFilesJson" runat="server" />

 

 

<div class="upload-panel">

 

 

<div class="upload">

 

 

<object id="SilverlightUpload" data="data:application/x-silverlight," type="application/x-silverlight-2"

 

 

width="400px" height="120px">

 

 

<param name="source" value='<%= ResolveUrl("~/Upload.xap") %>' />

 

 

<param name="background" value="white" />

 

 

<param name="minRuntimeVersion" value="2.0.31005.0" />

 

 

<param name="autoUpgrade" value="true" />

 

 

<param name="windowless" value="true" />

 

 

<param name="InitParams" value='<%= InitParameters %>' />

 

 

<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">

 

 

<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"

 

 

style="border-style: none" />

 

 

</a>

 

 

<telerik:RadUpload ID="radUpload" ControlObjectsVisibility="All"

 

 

AllowedFileExtensions=".stl,.zip"

 

 

MaxFileSize="80000000"

 

 

runat="server" InitialFileInputsCount="5">

 

 

</telerik:RadUpload>

 

 

 

 

 

</object>

 

 

<div class="uploaded-files" >

 

 

</div>

 

 

 

 

 

</div>

 

 

 

</div>

 

 

</asp:Panel>

 

 

 

 

 

 

</telerik:RadAjaxPanel>



this code is giving me a javascript error, So please help me ho i can save the file in a folder.If i am using foreach loop than how i will use silverlight control for same.

 

foreach (Telerik.Web.UI.UploadedFile file in radUpload.UploadedFiles)

 

 

 


 

int position = file.FileName.LastIndexOf("\\");

 

 

 

 

 string fileName = (position == 0 ? file.FileName.Substring(position) : file.FileName.Substring(position + 1));

 

 

 

 

 

 string filePath = Server.MapPath(m_path + "/" + orderIdPath + fileName);

 

 

 file.SaveAs(filePath);

 

 


}


Please Help me out this problem.

thanks,

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 28 May 2010, 04:35 PM
Hello Ted Bielenda,

Could you please clarify your requirement, what do you mean by how i can save the file if these both are diffrent.

As for how to determine whether the client has Silverlight installed or not, please take a look at the following video.

Regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Ted Bielenda
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or