My implementation was in fact using sfValidatorFile to validate the file's mime type, etc. Trusting this to be as the documentation said it is, I looked for every other possible reason why my files wouldn't upload.
sfValidatorFileis quite interesting as it does a number of things:
- Validates that the uploaded file is an image in a web format (
- Renames the file to something unique
- Stores the file in the given
- Updates the
logocolumn with the generated name
Files wouldn't upload properly in Symfony 1.4 even with using the sfValidatorFile.
Manually loop over and move files to the upload directory.
The code I used in my actions file was like this:
I hope this helps someone figure out their code issues.
foreach ($request->getFiles($this->form->getName()) as $uploadedFile)
$uploadDir = sfConfig::get('sf_upload_dir') . '/assets';
move_uploaded_file($uploadedFile["tmp_name"], $uploadDir . "/" . $uploadedFile["name"] );