<html>
<% Response.Buffer=True %>
<!--#include FILE="../company/check.asp"--> 
<head>
<title>执照上传</title>
<link href="../images/public.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body topmargin="20">
<!--#include FILE="upload_asjob.asp"--> 
<%
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize>0 then
	if file.fileSize>50*1024 then
		Response.Write("图片已经超出50K的上限，请压缩再传")
		response.write "<a href=uploadzhizhao.asp>返回"
	else
		

		'自动生成文件名
		filename=date()
		filename=filename&time()
		filename=replace(filename,"-","")
		filename=replace(filename,":","")
		filename=replace(filename," ","")
		filename=filename+"."
		filenameend=file.filename
		filenameend=split(filenameend,".")
		if filenameend(1)="gif" or filenameend(1)="jpg" then
		filename=filename&filenameend(1)
		file.saveAs Server.mappath("../upimages/company/"&filename)
%>
<%
	Response.Write("广告图片上传上传成功，请复制下面地址")
%>
<script>
function jm_cc(ob)
{
	var obj=MM_findObj(ob); 
	if (obj) 
	{
		obj.select();js=obj.createTextRange();js.execCommand("Copy");}
		alert('复制成功，粘贴到你要调用的html代码里即可!');
	}
	function MM_findObj(n, d) { //v4.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)
   {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
   }
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
  </script>
 <input class="but2" onClick="jm_cc('textarea1')" type="button" value="复制到剪贴板" name="button">
<input type="text" size="40" value="upimages/company/<%=filename%>" name="textarea1">
<%
   	 else
    		response.write "文件格式不对"
    		response.write "<a href=uploadzhizhao.asp>返回"
   	 end if
    set file=nothing
	end if
	else
    	response.write "文件内容不能为空"
    	response.write "<a href=uploadzhizhao.asp>返回"
	end if
	set upload=nothing
	response.write "<br>"
%>