PHP上传文件

PHP文件上传详解
本文详细介绍了PHP中文件上传的相关配置指令,包括file_uploads、max_execution_time等,并解释了$_FILES数组的使用方法及文件上传函数如is_uploaded_file()与move_uploaded_file()的功能。此外,还列举了常见的上传错误代码。

1.PHP的文件上传/资源指令

1.file_uploads=on/off

2.max_execution_time=integer

3.memory_limit=integer M

4.upload_max_filesize=integer M

5.upload_tmp_dir=string

6.post_max_size=integer M

2.$_FILES数组

1.$_FILES['userfile']['error']

2.$_FILES['userfile']['name']

3.$_FILES['userfile']['size']

4.$_FILES['userfile']['tmp_name']

5.$_FILES['userfile']['type']

3.PHP的文件上传函数

1.确定是否上传文件

bool is_uploaded_file(path)

2.移动上传文件

bool move_uploaded_file(filename,destination)

4.上传错误消息

1.UPLOAD_ERR_OK,0

2.UPLOAD_ERR_INI_SIZE,1

3.UPLOAD_ERR_FROM_SIZE,2

4.UPLOAD_ERR_PARTIAL,3

5.UPLOAD_ERR_NO_FILE,4

转载于:https://www.cnblogs.com/pinnasky/archive/2011/02/09/1950161.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值