我正在尝试使用php-uploader(https://github.com/CreativeDream/php-uploader)库,我希望它在上传图像时保存自定义名称。如何正确地使[被替换]字段获得新名称?
以下是我的回复。
阵 ( [files] =>排列 ( [0] => /var/2/17xxxxxx/bat1.jpg [1] => /var//2/17xxxxxx/bat2.jpg )
[metas] => Array
(
[0] => Array
(
[date] => Mon, 03 Oct 2016 21:00:37 +0200
[extension] => jpg
[file] => /var/2/17xxxxxx/bat1.jpg
[name] => bat1.jpg
[old_name] => bat1.jpg
[replaced] =>
[size] => 1029224
[size2] => 1,005.10 KB
[type] => Array
(
[0] => image
[1] => jpeg
)
)
[1] => Array
(
[date] => Mon, 03 Oct 2016 21:00:37 +0200
[extension] => jpg
[file] => /var/2/17xxxxxx/bat2.jpg
[name] => bat2.jpg
[old_name] => bat2.jpg
[replaced] =>
[size] => 573283
[size2] => 559.85 KB
[type] => Array
(
[0] => image
[1] => jpeg
)
)
)
)
答案 0 :(得分:1)
如果您查看php-uploader文档中有一个“title”选项,使用它可以设置新文件名