WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

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

Open mrjfalk opened this issue 5 years ago • 8 comments

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

  • Being able to drag-and-drop deferred StorageFile's is crucial for many types of applications; e.g. comunication apps (e.g. discord, Teams etc), FTP apps, ZIP apps etc.
  • It works when sharing files with other UWP application, under project Reunion it makes sense the behavior is consistent across Win32 and UWP.

Scope

Capability Priority
StorageFile.CreateStreamedFileAsync should work with File Explorer Must
StorageFile.CreateStreamedFileAsync should work with other Win32 apps accepting files Must

mrjfalk avatar Aug 12 '20 21:08 mrjfalk

Thanks for the report; will follow up internally.

ptorr-msft avatar Aug 13 '20 19:08 ptorr-msft

@kevinguo305 can you include this in your shell discussions?

stevewri avatar Sep 21 '20 19:09 stevewri

https://task.ms/28419545

ptorr-msft avatar Sep 21 '20 19:09 ptorr-msft

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

tritter avatar Sep 20 '21 14:09 tritter

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

ptorr-msft avatar Sep 20 '21 15:09 ptorr-msft

@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.

tritter avatar Sep 22 '21 18:09 tritter

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

ikas-mc avatar Dec 20 '21 06:12 ikas-mc

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.

kevinguo305 avatar Jan 28 '22 19:01 kevinguo305