手机分类
  导航: 电脑时代在线 · 网站开发 · CgiPerl教程 · CGI应用技巧
有问题吗?看 疑难解答 电脑术语

用 perl 完成文件上传

 
硬件盘点
手机推荐
 
『用 perl 完成文件上传』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-9-13 


示例的 HTML 文件如下:
<html>
<body>
<form method="POST" action="psupload.cgi" ENCTYPE="multipart/form-data">
File 1:
<input type="file" name="FILE1">
<br>
File 2:
<input type="file" name="FILE2">
<br>
<input type="submit" value="Upload!">
</form>
</body>
</html>

后台的 Perl 程序如下:

#!/usr/bin/perl
#######################################
## Perl Services Upload Helper v1.0 ##
## http://www.perlservices.com ##
## perlservices@perlservices.com ##
## ###########################################
## You should carefully read all of the following terms and conditions ##
## before using this program. Your use of this software indicates your ##
## acceptance of this license agreement and warranty. ##
## This program is being distributed as freeware. It may be used ##
## free of charge, but not modified below the line specified. This copyright ##
## must remain intact. ##
## ##
## By using this program you agree to indemnify Perl Services from any ##
## liability. ##
## ##
## Selling the code for this program without prior written consent is ##
## expressly forbidden. Obtain permission before redistributing this ##
## program over the Internet or in any other medium. In all cases the ##
## copyright must remain intact. ##
## ##
## There are security hazards involved with this script. Read the readme file##
## before using the script. ##
################################################################################

##
## Start setting up options here:

## Your path to where you want your files uploaded.
## Note: NO trailing slash
$basedir = "/home/path/to/directory";

## Do you wish to allow all file types? yes/no (no capital letters)
$allowall = "yes";

## If the above = "no"; then which is the only extention to allow?
## Remember to have the LAST 4 characters i.e. .ext
$theext = ".gif";

## The page you wish it to forward to when done:
## I.E. http://www.mydomainname.com/thankyou.html
$donepage = "http://www.perlservices.com/";

################################################
################################################
## DO NOT ED99v OR COPY BELOW THIS LINE ##
################################################
################################################

 

 

 

use CGI;

[1] [2] 下一页  


如果您有什么疑问,可以至论坛提出或者解答他人的疑问   返回页面顶部

】【关闭窗口
·上一篇教程:
·下一篇教程:
·导航: 电脑时代在线 · 网站开发 · CgiPerl教程 · CGI应用技巧
相关文章
 
搞笑自拍|图片故事|美女图库|体坛宝贝|明星爆料|世界奇观|风光摄影|历史回忆|大千世界
Photshop超炫图片
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部  
网站文本地图
  版权所有:电脑时代在线 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2007 www.PCvz.com online services. all rights reserved. 蜀ICP备05015578
Template designed by LaoJiang. Optimized for 1024x768 to Firefox,Opera and MS-IE. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光