简体   繁体   English

从Flash文件上传器中检索文件名

[英]Retrieve file names from flash file uploader

I am using the flash uploader that comes with Quform for wordpress to allow up to 5 files. 我正在使用Quform随附的Flash上​​传器供wordpress使用,最多允许5个文件。 I am trying to retrieve the file names but i only ever get the first one. 我正在尝试检索文件名,但是我只有第一个。 $filesA All the files upload without issue but I never get all the names. $ filesA所有文件上传都没有问题,但是我从不知道所有名称。

Here is my code (php) I am using 这是我正在使用的代码(php)

$myfiles= $form->getValue('iphorm_x_x');
$filesA = $myfiles[0]['text'];
$filesB = $myfiles[1]['text'];
$filesC = $myfiles[2]['text'];
$filesD = $myfiles[3]['text'];
$filesE = $myfiles[4]['text'];

I only ever get the first file name. 我只有第一个文件名。 Not sure why or where it is going wrong 不知道为什么或哪里出了问题

Many thanks Patrick 非常感谢帕特里克

Found the answer after using Marc B to get existing file names 使用Marc B获取现有文件名后找到了答案

$myfiles= $form->getValue('iphorm_x_x');
foreach ($myfiles as $file) {
    echo File Name: ' . $file['text'];
}

:) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM