VRaptor - File upload in IE 8/9 does not work

3

I'm trying to upload files and it's not working in IE8.

NOTE: It works in Chrome and Firefox perfectly.

I've been researching and seen that IE 8/9 does not support FormData as enctype . Ex:

<form id="form" method="post" enctype="multipart/form-data" action="/xpto/upload">

However, according to the vRaptor documentation this enctype is necessary for me to receive my UploadFile instantiated on the Controller. Ex.:

@Post("/xpto/upload") 
public void upload(UploadedFile arquivos[])

And, in fact, I tested it on Chrome and when I do not put enctype="multipart/form-data" my files ( UploadFile arquivos[] ) comes with null , when I put it works correctly.

In this situation I would like to know if there is any way I can make my upload work in vRaptor in IE 8 without having to use enctype="multipart/form-data" .

Thanks in advance for your attention.

    
asked by anonymous 29.09.2016 / 20:49

1 answer

0

It may not work in IE 8/9 because the page is being loaded in compatibility mode.

In any case, try also to place the encoding attribute with the same value as enctype :

<form id="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" action="/xpto/upload">

It's okay to have both, works fine for all browsers.

    
26.10.2016 / 22:31