GuyFawkes
GuyFawkes

Reputation: 1706

How to drop a file from windows form(listView) to desktop(any explorer window) without temp file

I know this is normaly implemented with a temp file but this wont work here since we are dealing with pretty large files stored in a database.

so far my idea is to create a small temp file that has a unique name and do a FileSystemWatcher monitoring the drop to get the path. but this doesnt seem optimal eighter.

are there any other ideas you guys could point me to?

maybe with virtual files? if so - how?

will be greatful for any hint.

thanks.

Upvotes: 3

Views: 1048

Answers (1)

Pieter van Ginkel
Pieter van Ginkel

Reputation: 29632

What you're looking for is a fully functional implementation of IDataObject. See http://www.codeproject.com/KB/dotnet/DataObjectEx.aspx for an example of how this can be achieved. This implementation allows you to provide a MemoryStream which contains the actual file drag/drop contents.

Upvotes: 3

Related Questions