|
upload_file_multipale_html.jsp
-----------------------------------------
<%@page import="java.io.File"%>
<title>Multipale file upload by using apache.commons.fileupload
First name:
Last name:
Specify file:
--------------------------------------------
upload_file_multipale.jsp
-------------------------------------------
<%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@ page import="org.apache.commons.io.FilenameUtils"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="java.lang.Exception"%>
<center>
<p><b>First Name:</b>
<%= request.getParameter("fname")%>
<p><b>First Name:</b>
<%= request.getParameter("lname")%>
<%
String itemName="";
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (!isMultipart){
out.println("The Form is not Multipart!!!!!");
}
else
{
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
out.println(e.toString());
}
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if (item.isFormField()){
String name = item.getFieldName();
String value = item.getString();
}
else {
try {
itemName = item.getName();
itemName = FilenameUtils.getName(itemName);
File savedFile = new File(config.getServletContext().getRealPath("/")+"uploadedFiles/"+itemName);
item.write(savedFile);
session.setAttribute("FileName",itemName);
} catch (Exception e) {
out.println(e.toString());
}
}
}
}
%>
<table align="center" border="1">
<td>
<%
String FileName = (String)session.getAttribute("FileName");
File savedFile = new File(request.getContextPath() +"/uploadedFiles/"+FileName );
%>
<img src="<%=savedFile %>" width="800" height="800">
</td>
</table>
So when I am trying to run these files I can successfully upload my image and display it back but I cannot get the values that I had mentioned in the text fields and it is displaying null
|
|
|
|
|
Hi,
My name is Azeem and i'm a student of computer sciences.
i need help about my project.
i am developing an application using optical character recognition (OCR) for android system Mobiles.
i have some difficulty in choosing tools for this.
what are the best tool for developing Android application.?
i want to know is Java suitable for OCR or C# is best for OCR ?
Can we convert the java program is Android Application ?
or can we convert the C# program is Android Application ?
i am waiting for ur reply... Plz reply soon...
thank you ..
|
|
|
|
|
Why have you posted this here? You have already asked this in the C# forum, when it is a Mobile issue. Please post in one forum only as detailed in the Posting Guidelines[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
Friends suggest me how to read data bytes directly from Port rather than buffer. I want to do this because i want to calculate the time between each incoming byte from serial port.
|
|
|
|
|
Using Google will find lots of suggestions[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
mahesh waghmale wrote: between each incoming byte from serial port.
Just to be clear...
In terms of a serial port it is always in fact buffered in some way by the hardware itself. It might not even be possible to read a single byte.
Following explains this well enough.
http://tldp.org/HOWTO/Serial-HOWTO-18.html#fifo_[^]
|
|
|
|
|
I have a problem with connected ireport with hibernate, I added all jars and all pojos and mapping files in the ireport classpath but always it appears for me an error in ireports :
entity class not found pojosmapping.Commande
here is a capture :
http://s12.postimage.org/96h6yplv1/image.png
the directory in which I point in ireport contains :
http://s11.postimage.org/40n1keymr/image.png
and the pojosmapping contains
http://s11.postimage.org/55h3psl3n/image.png[^]
and all this files are generated by netbeans IDE, I have never encoutered a problem like this there may be a bug in ireport 4.7.0 ?
do you have any idea
|
|
|
|
|
have you added the stuff also to the build?
There is a difference between the developing in the IDE (Netbeans/Eclipse) and running the program.
There might be some reference missing.
|
|
|
|
|
have you added the stuff also to the build?
sorry I don't understand this sentence,
can you explain more
thanks
|
|
|
|
|
You have added all the hibernate stuff into your project - right?
So have you added it also to the Java build? the IDE will build the app each time you start it from your IDE or when you release the app. The hibernate bits&bytes need to be in that build too.
I don't know which kind of frameware you use and what you do there, but there must be a config file for the build. manifest file?Make sure the hibernate stuff is added there.
|
|
|
|
|
Hi Friends,
Please suggest me code in java which calculate CRC(16) in separate bytes i.e crc_hi and crc_low.
Thanks in advance.
|
|
|
|
|
A Google search[^] gives lots of suggestions.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I have recently been asked to do some work with a Lucene installation. In short, I need to access the tokens that Lucene creates for a given document.
Does anyone know how I can get the tokens with Java?
Thanks in advance,
John.
|
|
|
|
|
jgrogan wrote: Does anyone know how I can get the tokens with Java? Not off hand, but you could try here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks Richard.
I have spent quite a lot of time with Google searching for an answer - including the Apache site, but haven't found anything. Every example seems to be about how to get Lucene to index a document!
|
|
|
|
|
Did you read this[^]?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
guys I need your help for source code Speech Recognition for greenfoot or java.
I need your answer soon..
thanks all
|
|
|
|
|
My answer is: Google.
Was that soon enough?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
My answer is the following:
I don't know what greenfoot is. It may be a project you're developing, or it may be another project altogether. This is not relevant at this point. What is relevant, however, is:
- You didn't seem to read the FAQs for posting questions in these forums. Here, let me help you. Read here[^] and then here[^]
- You didn't seem to have made any previous effort to solve this yourself. If you do try to solve this and run into problems, then you are more then welcome to post a question, mentioning the details of your specific problem and where you ran into problems.
Taking this into consideration, your question is downvoted and reported. Have a nice day!
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|
This question is not following any of the established rules to post questions.
This is why you are getting downvoted.
You should truly improve your question by adding more detail, which is your specific doubt, try to search google... Come back with specific questions and we will gladly help (if we know how to do it).
Nobody will be able to give you the kind of help you ask (it is too wide and general).
|
|
|
|
|
I can't use sql server 2000 use in java code
error is:
Tcp/ip connection is to host failed
|
|
|
|
|
This has nothing to do with Java. You are trying to access a system across a network and for some reason the target system is not responding. Go and do some investigation to see why.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Aren't we supposed to run packet sniffers across the entire intarweb to find the problem?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Yes, but mine has a cold so it can't smell much at the moment.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
It may be necessary to configure such an old version of SQL Server to use TCPIP. By default, it uses named pipes only, doesn't it?
And do not forget to configure the firewalls of both client and server.
|
|
|
|