lundi 29 février 2016

How to get image if I drag and drop an Image from Google Chrome or Internet Explorer in AS3

I am trying to drag an Image from Google Chrome or Internet Explorer and Drop into my Flex Project but I am unable to get Image directly from temp folder like Mozilla Firefox,

For Example I am using the following codes go get drag drop images from system temp folder in case of Mozilla Firefox:

this.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onNativeDragDrop);

private function onNativeDragDrop(vEvent:NativeDragEvent)
    var dropFiles:Array = vEvent.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;

    if(dropFiles && dropFiles.length > 0)
        var original:File = File(dropFiles[0]);
        var nativePath:String = original.nativePath;

In nativePath i am getting the path where the image is initially stored like : "C:\Users\User_Name\AppData\Local\Temp\ubeh2wbl.bmp"

But In case of Google Chrome or Internet Explorer I am getting NULL in nativePath.

So I Don't know where Google Chrome or Internet Explorer initially storing the images.

Does anyone have an idea where it is storing or how to solve this problem ?

Aucun commentaire:

Enregistrer un commentaire