This topic is locked

validate filename before import

5/22/2016 5:48:52 PM
PHPRunner General questions
M
macalister author

Hello.
Is possible to validate a filename before import in phprunner 8.1?
for example:

if(filename != 'template.xlsx'){

return false;

else

return true;


I would appreciate any ideas to do that.
Thanks

Sergey Kornilov admin 5/23/2016

Yes, you can do that. Check this example:

http://xlinesoft.com/phprunner/docs/rename_uploaded_file.htm
Your file name will be in $fileArray[$i]["usrName"] variable.
EDIT: I missed the part where you talking about import. In import you do not have an option to check the file name before importing.