Hi,
Hope someone can help shed some light on my problem... the project has
to be released today.... :-(
I'm uploading files followin the example code in the symfony
doumentation but if the file is an mp3 or avi etc it fails... I get
some very intersting symptoms.
The file uploads are being looped over and refernce save in a
database. If a video or audio file is uploaded it seems to loop far
more times than expected and create eronomous entries in the
database...
if ($this->getRequest()->hasFiles())
{
foreach ($this->getRequest()->getFileNames() as
$fileName)
{
$trueFileName =
$this->getRequest()->getFileName($fileName);
$fileSize =
$this->getRequest()->getFileSize($fileName);
$fileType =
$this->getRequest()->getFileType($fileName);
$fileError =
$this->getRequest()->hasFileError($fileName);
$uploadDir = sfConfig::get('sf_upload_dir');
$carFile = new CarFile();
$carFile->setBabe($car);
$carFile->setMimeType($fileType);
$carFile->setPath($trueFileName);
$carFile->save();
$this->getRequest()->moveFile($fileName,
$uploadDir.'/
cars/'.$trueFileName);
}
}
The entries that end up in the database refer to the rout of the page
submitting the data?
Any suggestions would be much appreciated!
Thanks
Ali
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---