开发者

is it possible to drag and drop photos from desktop to Flex Web app to upload them?

I use Flex 4 wish I can let users drag/drop photos from their computer to the web app to upload them auto开发者_开发技巧matically.


The answer to this used to be simply, No - it's not possible.

However, with HTML5's File API and drag & drop browser integration, it's more feasible.

This article gives a good overview of how HTML drag & drop works. If you just want to add drag & drop support for file uploads, that could be as far as you need to go -- ie., do the upload in HTML, and once it's complete, let Flex know by calling into it use ExternalInterface.

However, if you were feeling more adventurous, once you have the file in the browser, you would be able to pass it through to the flex app through an ExternalInterface call, and use the contents within the app. (Eg., by displaying an image).

It's worth nothing that this is an HTML5 solution, and support for the File API & drag'n'drop varies between browsers.


It is possible only in AIR application that is properly installed on user's computer and runs outside of browser.

It's not possible in browser.


There is another option: You can use FlexIFrame to display an IFrame within your Flex app. Within the Boundaries of this Frame the app behaves like your Html-Browser. This means you can display a Webpage that handles your File Dropping and upload to the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜