一共两个文件:index.php,action.php。将要上传的文件的文件名改为test,与这两个文件放在一起,运行index.php,选读取,将读取的所有数据Copy,在远端服务器上面也运行这个程序,Paste到输入框中,选保存。二进制文件就被上传了。
index.php
---------------------------------------------------------
<html>
<head>
<title>以文本方式上传二进制文件的PHP程序</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<table width="760" border="0" cellspacing="0" cellpadding="0" height="25">
<tr>
<td>
<div align="center"><b>图片上传</b></div>
</td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<form name="form" method="post" action="action.php" target="_blank">
<div align="center">
<textarea name="pic" cols="80" rows="15"></textarea>
<br>
<input type="radio" name="view" value="0" checked>
保存
<input type="radio" name="view" value="1">
试看
<input type="radio" name="view" value="2">
读取<br>
<input type="submit" name="OK" value=" 确 定 ">
<input type="reset" name="RESET" value=" 取 消 ">
</div>
</form>
</td>
</tr>
</table>
</body>
</html>
---------------------------------------------------------
action.php
---------------------------------------------------------
<?