I can't figure out what is wrong with this code for file uploads. I am trying to specify multiple extensions for the file upload - it works with a single extension, but if I specify more, it fails and only accepts the last item in the list, even though the error message appears to be self-contradicting. If no extensions are specified the system default list works correctly, but I need to add some extensions.
I am enclosing the minimal code, since after trying everything, modifying this code was the only difference between success and failure:
This works (regardless of the extension)
$file = file_save_upload('sequencefile',
array(
'file_validate_extensions' => array('seq')));
This fails on 'jpg', but works on 'seq'; moving jpg to the end of the list works for jpg, but then fails for the others.
$file = file_save_upload('sequencefile',
array(
'file_validate_extensions' => array('jpg, jpeg, png, gif, txt, doc, docx, ab1, seq')));
The error message on a jpg file is as follows, even though jpg is clearly in the list:
"The specified file mbpdpermissionsP2.jpg could not be uploaded. Only files with the following extensions are allowed: jpg, jpeg, png, gif, txt, doc, docx, ab1, seq."
What am I missing? it should be very simple and yet I can't get it to work.
thanks!