>
var video = documentgetElementById("videoElement"); //获取前台要截图的video对象
videosetAttribute('crossOrigin', 'anonymous') // 跨域处理
var canvas = windowcanvas = documentcreateElement("canvas");
canvaswidth = 500;
canvasheight = 300;
canvasgetContext('2d')drawImage(video, 0, 0,500,500); // 将当前视频渲染在画布上,大小和视频分辨率一致
var images = canvastoDataURL("image/png"); //canvas的api中的toDataURL()保存图像[toDataUrl](>
和上传没有关系
是你显示的时候这样写
responsewrite "<img scr='' height=xx weight=xx>"
加上长宽限制就可以了!
上传界面:
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="border">
<form name="form1" method="post" action="upfilesasp" enctype="multipart/form-data">
<tr>
<td height="25" valign="middle" align="center" colspan="2" class="Title"><strong>批量上传产品</strong></td>
</tr>
<form name="form1" method="post" action="upfilesasp" enctype="multipart/form-data">
<tr class=CommonListTitle height="25" bgcolor="#eeeeee">
<td height="22" align="center" valign="middle" class="tdbg"> 文件上传
<input type="hidden" name="act" value="upload">
(提交后请稍等!)</td>
</tr>
<tr c>
<td height="22" align="center" valign="middle" class="tdbg">
<script language="javascript">
function setid()
{
str='<br>';
if(!windowform1upcountvalue)
windowform1upcountvalue=1;
for(i=1;i<=windowform1upcountvalue;i++)
str+='文件'+i+':<input type="file" name="file'+i+'" style="width:250"><br>';
windowupidinnerHTML=str+'<br>';
}
</script>
<li> 上传个数:
<input name="upcount" type="text" value="1" size="10">
<input name="Button" type="button" class="button" onClick="setid();" value="· 设定 ·">
</li>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td align="center" valign="middle" class="tdbg" id="upid"> 文件1:
<input type="file" name="file1" style="width:250" value=""></td>
</tr>
<tr bgcolor="#eeeeee">
<td height="22" align="center" valign="middle" class="tdbg">
<input name="Submit" type="submit" class="button" value="· 提交 ·">
<input name="Submit2" type="reset" class="button" value="· 重执 ·"></td>
</tr>
</form>
</table>
upfilesasp 上传结果:
<%
dim conn,mypath
set conn=servercreateobject("adodbconnection")
mypath=servermappath("//database/globalasa") '建立数据库连接
connopen "provider=microsoftjetoledb40;data source=" & mypath
%>
<!--#include FILE="upload_5xsoftinc"-->
<html>
<head>
<title>photo</title>
<link href="/style/stylecss" rel="stylesheet" type="text/css">
<meta >
protected bool btnFileUpload_Click()
{
Boolean fileOK = false;
//获取上传的文件名
string fileName = thisFileUpload1FileName;
//获取物理路径
String path = ServerMapPath("images/");
//判断上传控件是否上传文件
if (FileUpload1HasFile)
{
//判断上传文件的扩展名是否为允许的扩名"gif", "png", "jpeg", "jpg" ,"bmp"
String fileExtension = SystemIOPathGetExtension(fileName)ToLower();
String[] Extensions = { "gif", "png", "jpeg", "jpg", "bmp" };
for (int i = 0; i < ExtensionsLength; i++)
{
if (fileExtension == Extensions[i])
{
fileOK = true;
}
}
}
//如果上传文件扩展名为允许的扩展名,则将文件保存在服务器上指定的目录中
if (fileOK)
{
try
{
ViewState["pic"] = "images/" + fileNameToString();//获取上传成功后的路径
thisFileUpload1PostedFileSaveAs(path + fileName);
return true;
//MessageBox("文件上传完毕");
}
catch (Exception ex)
{
MessageBox("文件不能上传,原因:" + exMessage);
return false;
}
}
else
{
MessageBox("请正确的上传");
return false;
}
}
protected void MessageBox(string str)
{
PageClientScriptRegisterStartupScript(PageGetType(), "message", "<script language='javascript' defer>alert('" + str + "');</script>");
}
把扩展名改为你需要的就可以了
以上就是关于upload的什么属性用于设置覆盖全部的内容,包括:upload的什么属性用于设置覆盖、up主是什么意思、video视频,实现截图功能,获得base64图转file并上传等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)