HTML form fails to upload file when containing attribute target="_blank"

Not reproducible Issue #8124290


Ruth C.
Jul 9, 2016
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

[1] Navigate to
[2] In the “Method 4” section of the page, browse select to any local ascii-text file and then click the adjacent “OK” button.

A new tab or window should then open to display an analysis of the contents of the file. This has been working fine for years in Firefox, Chrome, Safari, and Opera, but does not appear to work in Microsoft Edge. When using Edge, the $_POST and $_FILES arrays turn up empty.

The problem appears to be the ‘target="_blank"’ attribute in the form that handles the upload. When this attribute is removed, a file is uploaded, but the result appears in the originating tab/window. The ‘target="_blank"’ attribute only creates a problem for the form that uploads a file; it works fine for the other forms on the same page.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

    • Thanks for the feedback on Edge. This is what I get back whenever I give it a text file:

      Space Group: 221 Pm-3m Oh-1, Lattice parameters: a=4.2
      Default space-group preferences: monoclinic axes a(b)c, monoclinic cell choice 1, orthorhombic axes abc, origin choice 2, hexagonal axes, SSG standard setting
      Sr 1b (1/2,1/2,1/2), Ti 1a (0,0,0), O 3d (1/2,0,0)
      Include strain, displacive distortions
      Reading CIF file… This program has bombed:
      Error: no data found in CIF file. read_cif 39 exit

      This happens in both Chrome and Edge. Would it be possible for you to upload the same file you are providing? 

      All the best,
      The MS Edge Team

    • As
      we have not received further information on how to repro this item of feedback

      • we will resolve it as not repro. Should you have the details needed in order
        for us to reproduce this problem in our test environments please feel free to
        reactivate this issue at your earliest convenience.


      the best,

      MS Edge Team

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    • I have just come across this same issue in the latest released version of Edge (Microsoft Edge 42.17134.1.0, Microsoft EdgeHTML 17.17134) and have produced a codepen example here, that demonstrates this.

      In the example (using Edge of course), if you Choose a .txt file for Form 1 and submit it, the request correctly includes the file. However, if you do the same with Form 2 and submit it, the request doesn’t include the file.

    • I have noticed similar behavior with an HTML form. In my case, I have a page with a file download control which the user can use to choose an image. Upon submission, the page will refresh with the image in the page. When I add formtarget="_blank" to the submit button, I expect the same page would render in a new tab. However, the page renders without the image (In Chrome, it renders with the image).
      My model contains an HttpPostedFileBase for the uploaded image. I notice that with formtarget=_blank, the ContentLength field is 0. Without the formtarget, ContentLength has the proper size.
      In summary to repo:

      1. Create an MVC view with an HTTO form with a file control connected to an HttpPostedFileBase in the model.
      2. Add a submit button with formtarget="_blank" connected to a method in the controller.
      3. In the controller method note the ContentLength of the HttpPostedFileBase member.
      4. Repeat without the formtarget and observe the ContentLength value.

    You need to sign in to your Microsoft account to add a comment.

    Sign in