简体   繁体   中英

FileOpenPicker and LocallyIncomplete (SMART) Files

I am currently attempting to read in files (that the user selects) and store them (with their permission). The trouble I am having is that, having SkyDrive installed and enabled, I have what are known as SMART files, noted with a LocallyIncomplete attribute.

What this means is that the SkyDrive app stores a reference to this file in SkyDrive, but does not actually pull the whole file until the user requests it (by using it in some way). This works totally fine if they access the file in the picker via the SkyDrive app (the drop down at the top left). It even marks those that are not completely offline as LocallyIncomplete while not marking those that are available offline.

The issue (that I was lucky enough to find) is that I have included a folder in my SkyDrive app inside of a library (specifically, my Documents library). This makes all of the files show up in the picker, as it should.

If I try and open any SkyDrive files from the library, then not only does it mark all of them as LocallyIncomplete (even when the SkyDrive app does not), but it throws a native IOException, which is impossible for my app to catch. This happens even if the file being requested is locally available through the SkyDrive App. This is consistently reproducible on my machine.

Upon further investigation, it seems that I can check the Provider property to make sure that files with the LocallyIncomplete attribute come from the SkyDrive app, which is good at least (in that I can avoid an uncatchable exception). This will work for now as a Workaround, but it's less than ideal.

Also, I haven't been able to find any mention of this on Connect/MSDN. I'm hoping a MSFT-y wouldn't mind double checking to see if there's a bug filed for this before I file one myself, as I haven't been able to find one.

Thanks.

LocallyIncomplete means the file is not 100% downloaded to the user's machine.

You can check this way

if (!file.Attributes.HasFlag(FileAttributes.LocallyIncomplete))
{
//dostuff
}

where file is of type StorageFile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM