【发布时间】:2015-02-01 08:20:10
【问题描述】:
我在 github 上找到了一个很好的函数,用于使用 php 上传图片,但我不知道它的一个参数。
upload_image($_FILES,'file',250,'city',500,'../../uploaded/',1048576);
- 此函数中的“文件”是什么?
- 这是在我的网站中使用的受信任函数吗?
【问题讨论】:
标签: php image function github upload
我在 github 上找到了一个很好的函数,用于使用 php 上传图片,但我不知道它的一个参数。
upload_image($_FILES,'file',250,'city',500,'../../uploaded/',1048576);
【问题讨论】:
标签: php image function github upload
考虑the lines:
$file[$fileIndex]['tmp_name']
$file[$fileIndex]['error']
$file[$fileIndex]['name']
$file[$fileIndex]['type']
$file[$fileIndex]['size']
$file是a three-dimensional array,由name、tmp_name、type、size、error的数组组成。
就是uploading files in PHP时看到的那种数组。
它调用move-uploaded-file,它将上传的文件移动到新位置。
此函数检查以确保文件名指定的文件是有效的上传文件(意味着它是通过 PHP 的 HTTP POST 上传机制上传的)。
如果文件有效,它将被移动到destination给出的文件名。
【讨论】: