locked
How to add SkyDrive file access?

    Question

  • It is convenient to add SkyDrive support in FilePicker. Where is the sample code?

    Charlie Chang L

    Thursday, September 13, 2012 5:39 AM

Answers

  • I selected a SkyDrive fiel by FilePicker and the file->Path returned a local path like C:\Users\Me\SkyDrive...\Photo.png. then I saved this path and go out of the create_task file and stream. However next time when I tried to open this SkyDrive local path, an exception happened and no image was displayed. No problem for a local file from FilePicker. It may have some sync problems to access the SkyDrive file.  


    Charlie Chang L

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 9:05 AM
    Saturday, September 15, 2012 1:48 PM

All replies

  • It is there by default. Once the file picker is open, drop down the list for Files to see it (near the bottom of this list)


    David Lamb

    • Proposed as answer by Jesse Jiang Friday, September 14, 2012 3:01 AM
    Thursday, September 13, 2012 11:22 PM
    Moderator
  • Nice. It hides in deepth.

    I can pickup image from SkyDrive now and it returns a path in sth like C:\...\skydrive...

    When I opened this file it crashed my program. The file from create_task is fine.

    Shall I need special processing? Where is the sample?

    BTW The files picked from Photos was also crashed although it is ok for files from Pictures. 


    Charlie Chang L

    Friday, September 14, 2012 3:11 PM
  • Look at the XAML Images sample which demonstrates picking and opening an image (from SkyDrive if desired).


    David Lamb

    Friday, September 14, 2012 7:07 PM
    Moderator
  • it sounds like you opened a local file synchronized by the SkyDrive desktop client (C:\Users\<you>\SkyDrive). That works if you have the desktop client installed. If you don't use can use the Windows Store SkyDrive App and pick from that app.

    In both scenarios your app will use the StorageFile class even though the low level data access will be very different (in one case the stream comes from the file system, in the other from the SkyDrive app).

    you don't need to write any special code to handle the App case, but you can provide hints to optimize the syncing of those files using the CacheddFileManager: http://msdn.microsoft.com/en-us/library/windows/apps/hh701431.aspx

    Chris

    Saturday, September 15, 2012 4:55 AM
  • I selected a SkyDrive fiel by FilePicker and the file->Path returned a local path like C:\Users\Me\SkyDrive...\Photo.png. then I saved this path and go out of the create_task file and stream. However next time when I tried to open this SkyDrive local path, an exception happened and no image was displayed. No problem for a local file from FilePicker. It may have some sync problems to access the SkyDrive file.  


    Charlie Chang L

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 9:05 AM
    Saturday, September 15, 2012 1:48 PM