Skip to content
Advertisement

Content-Type not allowed: fileUpload in Struts 2

I am new to Struts 2 and trying to do use fileUpload interceptor. I am attaching all my code layers

Action Class (FileUploadAction):

JavaScript

error.jsp:

JavaScript

Success.jsp:

JavaScript

fileUpload.jsp:

JavaScript

I am not understanding why I am getting this error

JavaScript

Although my uploading file format is .jpg.

Advertisement

Answer

You are getting this error probably because you don’t allow files with content type image/pjpeg. Use parameter of fileUpload interceptor to define allowed MIME types

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement