<form method="post" enctype="multipart/form-data" name="form1">
<table>
<tr>
<td><input name="pic" type="file" size="30"></td>
</tr>
<tr>
<td>
<input name="Submit" type="submit" id="Submit" value="Send">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</table>
</form><?php
if($Submit){
echo '<pre>';
print_r($_FILES);
echo '</pre>';
}
?>
<table>
<tr>
<td><input name="pic" type="file" size="30"></td>
</tr>
<tr>
<td>
<input name="Submit" type="submit" id="Submit" value="Send">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</table>
</form><?php
if($Submit){
echo '<pre>';
print_r($_FILES);
echo '</pre>';
}
?>
解决方案 »
- 急。PHP,ADODB 类库,如何连接oracle数据库并查询出数据
- mysq gbk写入,utf-8提取
- unexpected T_STRING, expecting T_VARIABLE 深夜未睡的大神们,靠你们了!
- PHP+iis运行首页外观显示不整齐的问题
- 关于file_exists的问题
- 请问如何按次序调用多个php文件,而且每次都用都需要get传递参数
- php 竖型排序
- 这算不算类,又没必要做成类
- !!!! 100分 nusoap utf8 -> gb2312 问题 !!!
- 我为什么返回不了这个递归的值呢?急救!!!
- 用php做web应用程序的时候在网络安全上需要注意什么问题?
- 急急急!!!php与Ms-sql
include ("../../lib/setting.php");PangRight($SAS_SESSION[userlogin][spwd]);
if (count($HTTP_POST_VARS)>0){
if(!empty($mydocfile)){
//echo "cp ".$attachfile." ".$mydocfile.$filename;
copy($attachfile,$mydocfile.$filename);
}
if(!empty($gdocfile)){
//echo "cp ".$attachfile." ".$gdocfile.$filename;
copy($attachfile,$gdocfile.$filename);
}
if(!empty($jishufile)){
//echo "cp ".$attachfile." ".$gdocfile.$filename;
copy($attachfile,$jishufile.$filename);
}
}
?>
<HTML>
<HEAD>
<TITLE> :::::: </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo ${CHARSET_.$SAS_SESSION[language]}; ?>">
<?php echo ${css_.$SAS_SESSION[language]}; ?><script language="javascript">
function sendform(){
if(document.dataform.attachfile.value==''){
alert("请添加上传文件!");
document.dataform.attachfile.focus();
return false;
} var fname='';
var str=document.dataform.attachfile.value;
fname=str.split("\\");
document.dataform.filename.value=fname[fname.length-1];
document.dataform.submit();
}
</script>
</HEAD><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" ><center>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Td8">
<table width="0" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="Td8" width="19"> </td>
<td class="Td8a"><b>文档管理--文件上传</b></td>
<td class="Td8" width="48"> </td>
<td class="Td8"> </td>
</tr>
</table>
</td>
<td width="10" class="Td8"> </td>
</tr>
</table>
</center><form name="dataform" enctype="multipart/form-data" action="<?php echo $PHP_SELF;?>" method="post">
<input type="hidden" name="filename">
<center>
<table width="95%" border="0" cellpadding="0" cellspacing="1" class="Font12px">
<tr align="center"><td>
<input type="checkbox" class="ip2" name="mydocfile" value="<?php echo $path->userfiles."/user/".$SAS_SESSION[userlogin][uloginid]."/";?>"
<?php if(!empty($mydocfile)||(empty($mydocfile)&&empty($gdocfile)))echo "checked";?>>
上传到我的文件夹
<input type="checkbox" class="ip2" name="gdocfile" value="<?php echo $path->userfiles."/group/".$SAS_SESSION[userlogin][ugroupid]."/";?>"
<?php if(!empty($gdocfile)) echo "checked";?>>
上传到部门文件夹
<input type="checkbox" class="ip2" name="jishufile" value="<?php echo $path->userfiles."/jishu/";?>"
<?php if(!empty($gdocfile)) echo "checked";?>>
上传到技术文件夹
</td></tr>
<tr align="center"><td>
<input type="file" name="attachfile" size=30>
<input type="button" name="cmdUp" value="提 交" class="ipSub" onclick="javascript:sendform();">
</td></tr></table>
</center>
</form></BODY>
</HTML>
<form enctype="multipart/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>我们推荐您使用 $_FILES。……以上范例中 $_FILES 数组的内容如下所示。我们假设文件上传字段的名称如上例所示,为 userfile。 $_FILES['userfile']['name']
客户端机器文件的原名称。 $_FILES['userfile']['type']
文件的 MIME 类型,需要浏览器提供该信息的支持,例如“image/gif”。 $_FILES['userfile']['size']
已上传文件的大小,单位为字节。 $_FILES['userfile']['tmp_name']
文件被上传后在服务端储存的临时文件名。 $_FILES['userfile']['error']