Just noticed that if you try to set the uploadFolder before you call removeFolderSelection, then it defaults to 'Uploads', while setting it after will work:
//DOES NOT WORK - Uploads to 'Uploads'
$FilesField->uploadFolder = 'Uploads/myFolder';
$FilesField->removeFolderSelection();
//WORKS - Uploads to 'Uploads/myFolder'
$FilesField->removeFolderSelection();
$FilesField->uploadFolder = 'Uploads/myFolder';
This is because on line 596 of UploadifyField the uploadFolder is reset to 'Uploads'. Is that a neccacery step? Or am I using the wront function to remove the folderSelection?
Ok looking at it perhaps I should be using:
$FilesField->allowFolderSelection = false;
Aram
-------------------------------------------------------------------------
www.ssbits.com - Silverstripe Tuorials, Tips and other bits