0

File upload works fine with Firefox but when running the code from IE8, and after the upload has been successful IE displays a:

"File Download - Security Warning"

Do you want to save this file, or find a program online to open it? Name: uploadImage7c8c609b Type: Unknown File Type, 163 bytes From: 127.0.0.1

(sorry as a new user I can't post the screenshot!)

How can I switch this off?

user1128482
  • 185
  • 1
  • 1
  • 11

1 Answers1

1

dude, exactly the same thing happens to me.

The way out of this mess, in my case, is to change the mimetype of the response. (hint comes from here: https://stackoverflow.com/a/4723649)

I use spring's utillity, which in turn uses Jackson, to automatically transform objects to json strings.(Well, there's some configuration needs to be done, annotation-driven, to name but a few.)

So instead of writing like this:

public @ResponseBody
    ExtjsJsonCmd upload(..., MultipartFile file) {
        ....
        return new ExtjsJsonCmd(true,"certain message...");
}

I put down this:

public @ResponseBody
    String upload(..., MultipartFile file){
        ....
        return "{success:true, msg:'certain message...'}";
}

Hope it will make it through.

Community
  • 1
  • 1
DarKeViLzAc
  • 208
  • 1
  • 7