the MIME for your file is. Note that this behavior relies completely
on the browser's best guess for the MIME type and doesn't use anything
server-side to figure it out, eg. FileInfo, mime_content_type().
Is the file even being sent to the server in the first place? Log the
file size. And the error key--it should be zero.
And check the permissions on the dir where this should be stored. You
don't have to set it to 0777, just make sure the webserver owns it.
On Sat, May 30, 2009 at 6:40 AM, Arak Tai'Roth <nielsen.dustin@gmail.com> wrote:
>
> I could still really use a hand on this problem if anyone can offer
> it.
>
> On May 29, 4:49 am, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
>> Anyone able to help with this?
>>
>> On May 28, 7:29 am, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
>>
>> > So I have a problem uploading a flash video using MeioUpload in
>> > CakePHP. Here is my controller code for the add function:
>>
>> > function add()
>> > {
>> > if (!empty($this->data['Video']))
>> > {
>> > $mrClean = new Sanitize();
>> > $id = $this->Session->read('buildId');
>> > $slug = $this->Session->read('buildSlug');
>>
>> > $this->data['Video']['build_id'] = $id;
>>
>> > if ($this->Video->save($this->data['Video']))
>> > {
>> > $this->Session->setFlash('New video for build ' . $slug . ' have
>> > been added.');
>>
>> > $this->redirect('/builds/view/' . $slug);
>> > $this->exit();
>> > }
>> > else
>> > {
>> > $this->Session->setFlash('New video for build ' . $slug . ' could
>> > not be added.');
>>
>> > $this->redirect('/builds/view/' . $slug);
>> > $this->exit();
>> > }
>> > }
>> > }
>>
>> > and the code for the Video model:
>>
>> > class Video extends AppModel
>> > {
>> > var $name = 'Video';
>>
>> > var $actsAs = array(
>> > 'MeioUpload' => array(
>> > 'video' => array(
>> > 'dir' => 'videos/builds/uploads',
>> > 'create_directory' => false,
>> > 'allowed_mime' => array('video/x-flv'),
>> > 'allowed_ext' => array('.flv')
>> > )
>> > )
>> > );
>> > }
>>
>> > and the code for the add view:
>>
>> > echo $form->create('Video', array('action' => 'add', 'type' =>
>> > 'file'));
>> > echo $form->label('Video.video', 'Video:');
>> > echo $form->input('Video.video', array('label' => false, 'type' =>
>> > 'file'));
>>
>> > echo $form->submit('background.png');
>> > echo $form->end();
>>
>> > I've been through this now for the past 2 days and can't figure out
>> > anything wrong with the code, yet the video will not get uploaded and
>> > as such the database entry never gets created. I have no idea what the
>> > problem is so I have no clue what to look for. Is anyone able to help
>> > me with this?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment