alguem me ajuda ai sobre upload na maquina local funciona mas quando coloco no servidor de hospedagem da erro:
rg.apache.jasper.JasperException: Exception in JSP: /upload.jsp:28
25: if (MultipartFormDataRequest.isMultipartFormData(request))
26: {
27: // Uses MultipartFormDataRequest to parse the HTTP request.
28: MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
29: String todo = null;
30: if (mrequest != null) todo = mrequest.getParameter(“todo”);
31: if ( (todo != null) && (todo.equalsIgnoreCase(“upload”)) )
o codigo utilizado é:
-
<%
if (MultipartFormDataRequest.isMultipartFormData(request))
{
// Uses MultipartFormDataRequest to parse the HTTP request.
MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
String todo = null;
if (mrequest != null) todo = mrequest.getParameter("todo");
if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
{
Hashtable files = mrequest.getFiles();
if ( (files != null) && (!files.isEmpty()) )
{
UploadFile file = (UploadFile) files.get("uploadfile");
if (file != null) out.println("
- Form field : uploadfile"+"
Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"
Content Type : "+file.getContentType()); // Uses the bean now to store specified by jsp:setProperty at the top. upBean.store(mrequest, "uploadfile"); } else { out.println(" - No uploaded files");
}
}
else out.println("
todo="+todo); } %>
Seleciona um arquivo para upload : |