0

Hy all,

i use the following code for displaying the image. i am sending the image file from the my HTML page...

the following code is working for the image having name without any space example like:-test1.jpeg, but the following code is not working when i send the image having name with space.. example like:- test data.jpeg, data d1.jpeg.

can anyone help me to solve the above problem...?

out.println("File has been uploaded successfully");
		out.println("<html>");
		out.println("<body>");
		out.println("<table><tr><td width='210'></td><td> <img border=2 src=image/"+itemName.toString().trim()+" width=800 height=600></td></tr></table>");
		out.println("</body>");
		out.println("</html>");

Thanks
Yatin

5
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Sadun89
0

USE SINGLE QUOTE AROUND SRC attribute

out.println("File has been uploaded successfully");
		out.println("<html>");
		out.println("<body>");
		out.println("<table><tr><td width='210'></td><td> <img border=2 src='image/"+itemName.toString().trim()+"' width=800 height=600></td></tr></table>");
		out.println("</body>");
		out.println("</html>");
0

in html when you specify a name or source for anything, like say input fields, you can just write them without any quotes. but when that name or source is multi worded with space in between, you need quotes.

the example will clear it for you <input type=text name=NameField > here no quotes are required around NameField

but there will be in this one: <input type=text name="Name Field" > similarly it goes for your image src tag, because most probably the image you are picking up from your drive will have more then 1 word in its filename

Edited by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

-1

ya.... I agree with peter_budo.....
new technology coming out day by day...
its easy for use.....but before use it learn basic with old....it not a problem....
its my thought......................

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.