如何简单地上传文件?_编程10000问

<html><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

<script language="VB" runat="server">

      Sub UploadBtn_Click(Sender as Object, E as EventArgs)

        UploadFile.PostedFile.SaveAs(Server.MapPath("chunfeng.jpg"))

       MyImage.ImageUrl = "chunfeng.jpg"

        MyImage.Visible = true

      End Sub

    </script>

 

<head>

<title>星河影动之最简单的上传文件</title>

</head>

 

<body>

 

<form enctype="multipart/form-data" runat="server">

  <h3>请选择上传的文件: <input id="UploadFile" type="file" runat="server"> <asp:button Text="上传文件" onClick="UploadBtn_Click" runat="server/"> </h3>

  <hr>

<asp:image id="MyImage" Visible="false" runat="server/">

</form>

</body></html>

 

[1]

时间: 2024-11-02 16:54:20

如何简单地上传文件?_编程10000问的相关文章

如何把Recordset转换成彩色的XML文件_编程10000问

<%@ codepage="65001" %> <!-- #INCLUDE FILE="ADOVBS.INC" --> <% Response.ContentType = "text/xml" ' 如果不在 adovbs.inc 里,则设置一个常量.  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&qu

如何限制上传文件的大小?_编程10000问

 <%@ LANGUAGE="VBscript" %>      <html><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> <head>      <title>撼雪喷云之限传文件</title>      </head>      <body>      <

如何上传一个单纯的HTML文件?_编程10000问

fileup.htm<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />    < html >   < head > < title >千花飞舞之上传单个文件< /title > < /head > <body>   < form enctype="multipart/form-data

如何实现文件上传并自动归类功能?_编程10000问

upload.asp <form action=http://<%= Request. ServerVariables(SERVER_NAME)>/wdread.asp method=post> <p>主题: <input type=text name=subject><br>       作者:<input name=author type=text><br>       发布时间: <input name=dat

如何创建Word文件?_编程10000问

creatdoc.asp<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> <!DOCTYPE html PUBLIC "-//W3C/Dtd html 3.2 Final//EN"><head><title>星河影动之创建Word文件</title><META HTTP-EQUIV="Re

如何用ASP输出HTML文件?_编程10000问

<!--#include file="top.inc"--><%u_title=request.form("u_title")<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> ' 检查标题是否被输入.if u_title = "" then%><form method="P

如何实现无组件上传二进制文件?_编程10000问

<!--METADATA TYPE="typelib"      UUID="00000205-0000-0010-8000-00AA006D2EA4"    NAME="ADODB Type Library"--><%  Dim objStream  Set objStream = Server.CreateObject("ADODB.Stream")<?xml:namespace prefix =

如何一行行地读取文件?_编程10000问

dim input(30) <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> ' 定义一个数组,大小可随时更改.这里为了显示方便. file_path=Server.Mappath("index.html") Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f

如何计算下载一个文件需要多长时间?_编程10000问

<%Function DownloadTime(intFileSize, strModemType)Dim TimeInSeconds, ModemSpeed, strDownloadTime, AppendStringDim intYears, intWeeks, intDaysDim intHours, intMinutes, intSecondsintYears = 0intWeeks = 0intDays = 0intHours = 0intMinutes = 0intSeconds =