WindowsAppSDK
WindowsAppSDK copied to clipboard
Add support for StorageFile.CreateStreamedFileAsync to File Explorer and non-UWP apps
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 |
Thanks for the report; will follow up internally.
@kevinguo305 can you include this in your shell discussions?
https://task.ms/28419545
@ptorr-msft Are there any updates on this issue? What is a possible workaround can I use the older Win32 Apis in any way?
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 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.
We need to drag files from the app to explorer
- These files are non-local
- It is difficult to preprocess the file during the dragging process
- Unable to get the target file, So use CreatedStreamedFileAsync to create a file
- It can be used between uwp but not explorer. This affects the experience quite a bit
- Other tricky experiences are quite bad
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.