• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ContentType value coming as null

 
srikanth sankurthi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
contentType value is coming as null in fileprocess.jsp.

fupload.jsp
=======
<%@ page language="java" contentType="multipart/form-data; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>File Upload</title>
</head>

<body>
<form name="fform" action="fileprocess.jsp">
Upload File:<input type="file"/>
<input type="submit" value="submit"/>
</form>
</body>

</html>

fileprocess.jsp
============

<%
String contentType = request.getContentType();
out.println("contentType "+contentType);
%>
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP page directive sets the contentType of the response. You're inspecting the contentType of the request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic