How to send a file from a child window (popup window) to the opener window (parent window)?

I have a parent window where a popup window opens with using window.open() . The following is a snippet of code:

 window.helper = (data, filesArr) => { this.onReceiveMessage({ data }, filesArr); } this.postEditorWindow = window.open('some url here', "_blank", "height=100"); // postEditorWindow, I am using it later to close popup window. 

I want to send an array of files selected from a popup to the parent window, so I call:

 window.opener.helper(someData, e.target.files) 

... from a child / popup window that sends data correctly, but in IE Edge and IE 10/11 its behavior is strange. File information is lost. Although it works fine in Chrome and Firefox.

i.e. Inside IE, the type of the filesArr elements is [object File] when a file is selected, but when I send it through a helper function to the parent window, it becomes simple [object] , inside the parent window, so the file is not saved. enter image description here

Questions:

  • Is it possible to transfer the file data (BLOB) selected on the local computer between two or more windows?

  • If there is no data that we can transfer between two windows? Why data like [object File] cannot be transferred to IE and why does it work with Chrome / Firefox / Safari?

Does anyone have any ideas / hints? Please help.

0
javascript internet-explorer microsoft-edge file-upload
Apr 28 '17 at 13:19
source share

No one has answered this question yet.

See similar questions:

7
How do you communicate between two tabs / browser windows?

or similar:

7494
How to remove a specific element from an array in JavaScript?
5722
How to remove a property from a JavaScript object?
5129
How to return a response from an asynchronous call?
4829
How to include a javascript file in another javascript file?
2817
How can I upload files asynchronously?
1895
Open the url in a new tab (not in a new window) using JavaScript
360
List view The getListItemXmlAttributes method does not work with child publication items
12
How to transfer data to a parent window from a popup window?
one
Best way to transfer data between parent and popup page in angularjs
0
Close parent popup from child popup?



All Articles