Learning process of a Jsp beginner (8)
TheUnforgiven
Chapter 8 operations on image files-accessing and using the first Servlet of Blob data
I found some information on the Internet and adapted the following code based on my requirements:
------------------------------Upphoto.htm ------------------------------------
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> Untitled Document </title>
Head>
<Body>
Upload images:
<Form name = "form1" method = "post" action = "upphoto. jsp">
<Input name = "id" type = "text">
(Enter an integer as the ID of the image) <br>
<Input size = "50" name = "file" type = "file">
<Br>
<Input type = "submit" name = "Submit" value = "submit">
</Form>
<P> & nbsp; </p>
<P> & nbsp; </p>
Show Image: <br>
<Br>
<Form name = "form2" method = "post" action = "showphoto. jsp">
<Input type = "text" name = "vid">
(Enter the ID of the image) <br>
<Input type = "submit" name = "Submit2" value = "submit">
</Form>
</Body>
</Html>
---------------------------------------------------------------------------
Upphoto.htm includes two <form>: form1 is used to select the image to be saved in the database; form2 is used to display the image in the database.
----------------------------- Upphoto. jsp ----------------------------------
<% @ Include file = "include. inc" %>
<% @ Page contentType = "text/html; charset = gb2312" %>
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service