Vraptor - Uploading files to IE 8/9 does not work

Asked

Viewed 58 times

3

I’m trying to upload files and it’s not working on IE 8.

OBS.: Works on Chrome and Firefox perfectly.

I did some research and saw that the IE 8/9 can not stand FormData as enctype. Ex:

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

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

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

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

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

Thanks for your attention.

1 answer

1


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

Anyway, try to put also the attribute encoding, of the same value as enctype:

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

No problem having both, works well in all browsers.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.