microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.73k stars 309 forks source link

Add support for StorageFile.CreateStreamedFileAsync to File Explorer and non-UWP apps #140

Open mrjfalk opened 3 years ago

mrjfalk commented 3 years ago

Proposal: Add support for StorageFile.CreateStreamedFileAsync to File Explorer and non-UWP apps

Summary

Currently creating a StorageFile using the StorageFile.CreateStreamedFileAsync(...) API and assigning this to a drag and drop data (e.g. DragStartingEventArgs.Data.SetStorageItems(new[] {StorageFile.CreateStreamedFileAsync(...)})) and then dropping this in e.g. File Explorer and choosing Copy you will get an 0x80004002 (no such interface supported) error.

This was reported already 3 years ago (https://social.msdn.microsoft.com/Forums/windows/en-US/a40ee176-69c0-4080-976f-d10330ece712/uwpcreatestreamedfileasync-causing-0x80004002-in-desktop-apps?forum=wpdevelop) but no solution has been posted as far as I can see.

Dragging the file to a UWP application works fine.

Rationale

Scope

Capability Priority
StorageFile.CreateStreamedFileAsync should work with File Explorer Must
StorageFile.CreateStreamedFileAsync should work with other Win32 apps accepting files Must
ptorr-msft commented 3 years ago

Thanks for the report; will follow up internally.

stevewri commented 3 years ago

@kevinguo305 can you include this in your shell discussions?

ptorr-msft commented 3 years ago

https://task.ms/28419545

tritter commented 2 years ago

@ptorr-msft Are there any updates on this issue? What is a possible workaround can I use the older Win32 Apis in any way?

ptorr-msft commented 2 years ago

Currently there is no plan to fix this issue, sorry. If you describe the exact scenario you have we can look at possible workarounds.

tritter commented 2 years ago

@ptorr-msft The scenario is, I want to drag a file which isn't located locally. I need a way to drag a online file to the windows explorer, I can't find any other way than using the StorageFile.CreatedStreamedFileAsync, which shows the error as written in the summary.

ikas-mc commented 2 years ago

We need to drag files from the app to explorer

  1. These files are non-local
  2. It is difficult to preprocess the file during the dragging process
  3. Unable to get the target file, So use CreatedStreamedFileAsync to create a file
  4. It can be used between uwp but not explorer. This affects the experience quite a bit
  5. Other tricky experiences are quite bad
kevinguo305 commented 2 years ago

Thank you for the scenarios to help us better understand the motivations! We currently have our plans locked for the next several months, but we can consider this with our next wave of planning.