Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Video uploading Error

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 424 Views
  • Arun_India
    Avatar
    Community Member
    18 Posts

    Video uploading Error Link to this post

    Hi ,to all

    Video uploading Error from admin side.......

    when i try to upload an Video file from admin side, it shows an error.(test.flv (194.49KB) - HTTP Error)

    [Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent. ]

    what i do.. I have no idea....Pls help me.....?

    regards

    Arun

  • Bereusei
    Avatar
    Community Member
    94 Posts

    Re: Video uploading Error Link to this post

    Hi,

    how did you upload the video? Did you use another module like Uploadify, of something?
    It is also handy to post the code, so that everyone can see, what you´ve done.

  • Arun_India
    Avatar
    Community Member
    18 Posts

    Re: Video uploading Error Link to this post

    Hi, Bereusei

    Currently i am working in windows server in IIS with sql server 2008 as database....
    I checked FLV::echo_ffmpeg_test(); and the results shows
    FFMPEG is installed on your server and working properly. Code: 1

    Totally I am stuck with uploading and video thumbnail.

    My code is=======>
    1)Video .php
    <?php
    class Video extends DataObject
    {
    static $db = array ('Title' => 'Varchar(100)','Description' => 'Text');
    static $has_one = array ('VideoPage1' => 'VideoPage','Video' => 'FLV');
    }

    2)VideoPage.php
    <?php
    class VideoPage extends SectionPage {

    static $has_many = array ('Videos' => 'Video');
    static $has_one = array ('Filepath' => 'Filename');

    public static $icon = 'mysite/images/treeicons/video';

    public static $db = array(
    );

    //public static $has_one = array();

    public function canCreate($member = null) {
    if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) $member = Member::currentUser();

    if($member && Permission::checkMember($member, "ADMIN")) return true;

    // DEPRECATED 2.3: use canCreate() instead
    $results = $this->extend('alternateCanCreate', $member);
    if($results && is_array($results)) if(!min($results)) return false;

    // decorated permission checks
    $results = $this->extend('canCreate', $member);
    if($results && is_array($results)) if(!min($results)) return false;

    return $this->stat('can_create') != false || Director::isDev();
    }

    public function getCMSFields() {
    $fields = parent::getCMSFields();

    $fields->addFieldToTab("Root.Content.Videos", new FileDataObjectManager(
    $this,
    'Videos',
    'Video',
    'Video',
    array('Title' => 'Title', 'Description' => 'Description'),
    new FieldSet(
    new TextField('Title'),
    new TextareaField('Description')
    )
    ));

    return $fields;
    }

    function Thumbnail() {
    $Image = $this->Image();
    if ( $Image ) {
    return $Image->CMSThumbnail();
    } else {
    return null;
    }
    }

    }
    class VideoPage_Controller extends SectionPage_Controller {

    public static $allowed_actions = array (
    );

    public function init() {
    parent::init();
    }
    }

    3)VideoPage.ss

    <% if IncludeLeftPanel %>
    <% include LeftPanel %>
    <% end_if %>
    <div id="Content" class="typography <% if IncludeLeftPanel %>wLeft<% end_if %><% if IncludeRightPanel %>wRight<% end_if %>">
    <% if ClassName=="HomePage" %>
    <% control sectionPages %>
    <% if Children %>
    <div class="$URLSegment contentBox sectionSummary round shadow">
    <a href="$Link"><img class="icon" alt="$Title Icon" src='$icon.URL'/></a>
    <div class="description">
    <a href="$Link"><h3>$Tagline</h3></a>
    <p>$Blurb</p>
    <a href="$Link"><img class="headshot" alt="$Title Headshot" src='$headshot.URL'/></a>
    </div>
    </div>
    <% end_if %>
    <% end_control %>
    <% end_if %>
    <% if ComingSoon %>
    <% include ComingSoon %>
    <% else_if Content %>
    <% if NoContentBox %>
    $Content
    <% else %>
    <div id="ContentInner" class="round shadow">

    <link rel="stylesheet" type="text/css" href="Player/style.css">
    <center>
    <!--<div id="mediaplayer">H2connect Video Player </div>-->
    <video id="mediaplayer"></video>
    </center>
    <div align="center">
    <script type="text/javascript" src="Player/jwplayer.js"></script>
    </div>
    <!--$Content-->
    <ul>
    <% control Videos %>
    <li style="display:inline-block; *float:left;text-align:center;">
    Title:<h3>$Title</h3>

    <div style="margin: 3px auto; width:70px;text-align:center;padding:10px; border:0px solid #f7f7f7;">
    </div>

    <% control Video %>
    <div id="mediaplayer"></div>
    <script type="text/javascript">
    jwplayer('mediaplayer').setup({
    flashplayer: '/Player/player.swf',
    file: '$FLVLink',
    image: '$image'
    });
    </script>
    <script type="text/javascript">
    function Play(videoUrl)
    {
    var playlist = jwplayer('mediaplayer').getPlaylist();
    var newItem = videoUrl;
    playlist.push(newItem);
    jwplayer('mediaplayer').load(newItem);
    }
    </script>
    <div>
    <a href="#" onclick="Play('$FLVLink')">

    Thumbnail

    </a>
    </div>

    <% end_control %>
    Description:<h3>$Description</h3>
    </li>
    <% end_control %>
    </ul>
    <% if ClassName=="Page" %>
    <div>$Form</div>
    <% else_if Fields %>
    <div>$Form</div>
    <% end_if %>

    <% if ClassName == RegistrationPage %>
    <% if RegistrationForm %>
    <% control RegistrationForm %><% include MultiFormProgressList %><% end_control %>
    <div>$RegistrationForm</div>
    <% end_if %>
    <% end_if %>

    <div>$PageComments</div>
    </div>
    <% end_if %>
    <% end_if %>
    </div>
    <% if IncludeRightPanel %>
    <% include RightPanel %>
    <% end_if %>
    <% if IncludeOurPicks %>
    <% include OurPicks %>
    <% end_if %>

    Here i am used uploadify for uploading files.

    Pls find me a solution....

    Regards

    Arun

  • Bereusei
    Avatar
    Community Member
    94 Posts

    Re: Video uploading Error Link to this post

    If you want to upload swf, you must have something like this in the getCMSFields-function (in your Page class): SWFUploadConfig::addFileType('swf');
    Perhaps this is already the solution.

    This link could be interesting for you as well:
    http://www.leftandmain.com/silverstripe-screencasts/2010/08/23/filedataobjectmanager-media-features/

    Perhaps there is something you could use.

  • Arun_India
    Avatar
    Community Member
    18 Posts

    Re: Video uploading Error Link to this post

    Hi,Bereusei

    Can u explain briefly,because I am new to Silverstripe..

    Actually i had uploaded video file with above listed codes.

    The problem starts,
    When I am trying to get the video thumbnail and made some changes in code,all the errors were occured.
    Then i changed every thing but the error still appear.

    Where I add "SWFUploadConfig::addFileType('swf'); " . What about swf.

    Regards,
    Arun

    424 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.