Upload from Isolated Strorage or FileStream?

5 posts, 0 answers
  1. Pat Tormey
    Pat Tormey avatar
    20 posts
    Member since:
    Feb 2010

    Posted 28 Oct 2010 Link to this post

    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
  2. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 29 Oct 2010 Link to this post

    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).
  3. DevCraft banner
  4. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 01 Nov 2010 Link to this post

    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
  5. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 01 Nov 2010 Link to this post

    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.
  6. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 03 Nov 2010 Link to this post

    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
Back to Top
DevCraft banner