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

Upload from Isolated Strorage or FileStream?

4 Answers 118 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Pat Tormey
Top achievements
Rank 1
Pat Tormey asked on 28 Oct 2010, 06:59 PM
I need to create the file on the fly in SilverLight then upload it.
How can I use the SL RadUpload with a FileStream or How can I programatically add the file from Isolated Storage.
i.e I create the file name OK but IsloatedStorageFile does not seem to give up it directory.

All I'm trying to do is create a file on the fly to add to the upload of several user selected files.

Is there an easier way to do this?

Thanks
Pat New Hampshire USA

4 Answers, 1 is accepted

Sort by
0
Trude
Top achievements
Rank 2
answered on 29 Oct 2010, 08:32 AM
It seems that the only way to add items/files is with the file dialoge (the items collection is read only). I don't know if this is by design, but I would also like to see this feature (FileStream or MemoryStream).
0
Alex Fidanov
Telerik team
answered on 01 Nov 2010, 08:35 AM
Hello Jorn,

Currently, Silverlight can access files only through OpenFileDialog or as out of browser application with elevated trust. Uploading a memory stream directly is currently not supported with the RadUpload.
Assuming that you have a collection of FileInfo objects, you can wrap them into RadUploadSelectedFiles and add them in the RadUpload.CurrentSession.SelectedFiles collection and ready them for upload.

Sincerely yours,
Alex Fidanov
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
0
Trude
Top achievements
Rank 2
answered on 01 Nov 2010, 11:40 AM
I know that SL only can access (local) files through OpenFileDialog, but I think it would be a nice to handle all uploads in our application through a single interface. If RadUpload could access memory streams and upload them as if they were "real" files it would not break any security (or would it?). For example; if I have a RichTextEditor open and want to save documents on the server (not in the DB) it would be nice to route the stream to RadUpload.
0
Alex Fidanov
Telerik team
answered on 03 Nov 2010, 02:04 PM
Hello Jorn,

Your best option with using a memory | file stream for now is using the FileUploadStarting, described in this forum thread. There is also a sample project provided by Tina Stancheva. We are also considering utilizing WCF services with the RadUpload, which will allow uploading directly from a stream. You can vote for this request here.

Greetings,
Alex Fidanov
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
Asked by
Pat Tormey
Top achievements
Rank 1
Answers by
Trude
Top achievements
Rank 2
Alex Fidanov
Telerik team
Share this question
or