Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » 2.4.0 can't upload .f4v files to assets folder

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: 1996 Views
  • x75
    Avatar
    Community Member
    42 Posts

    2.4.0 can't upload .f4v files to assets folder Link to this post

    Hi, i upgraded a website to 2.4.0.
    Now I can't upload .f4v Videos to the assets folder anymore (with DOM installed).
    If I upload the file with a different extension and then try to change the file name I get the an error that the Extension is not allowed an a list of valid extensions. How can you change, extend that list?

    [User Error] Uncaught ValidationException: Validation error writing a File object: Extension is not allowed (valid: , ace, arc, arj, asf, au, avi, bmp, bz2, cab, cda, css, csv, dmg, doc, docx, flv, gif, gz, hqx, htm, html, ico, jar, jpeg, jpg, js, m4a, m4v, mid, midi, mkv, mov, mp3, mp4, mpa, mpeg, mpg, ogg, pages, pcx, pdf, pkg, png, pps, ppt, pptx, ra, ram, rm, rtf, sit, sitx, swf, tar, tgz, tif, tiff, txt, wav, wma, wmv, xhtml, xls, xlsx, xml, zip, zipx). Object not written.
    POST /admin/assets/EditForm/field/Files/item/153/DetailForm

    Line 931 in /var/syscp/webs/hempen/httpdocs/sapphire/core/model/DataObject.php
    Source

    922       $firstWrite = false;
    923       $this->brokenOnWrite = true;
    924       $isNewRecord = false;
    925       
    926       if(self::get_validation_enabled()) {
    927          $valid = $this->validate();
    928          if(!$valid->valid()) {
    929             // Used by DODs to clean up after themselves, eg, Versioned
    930             $this->extend('onAfterSkippedWrite');
    931             throw new ValidationException($valid, "Validation error writing a $this->class object: " . $valid->message() . ". Object not written.", E_USER_WARNING);
    932             return false;
    933          }
    934       }
    935
    936       $this->onBeforeWrite();
    937       if($this->brokenOnWrite) {

    Trace

    * DataObject->write()
    Line 867 of DataObjectManager.php
    * DataObjectManager_ItemRequest->saveComplexTableField(Array,FileDataObjectManager_Popup,SS_HTTPRequest)
    Line 296 of Form.php
    * Form->httpSubmission(SS_HTTPRequest)
    Line 134 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 152 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 152 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 152 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 152 of RequestHandler.php
    * RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    * Controller->handleRequest(SS_HTTPRequest)
    Line 283 of Director.php
    * Director::handleRequest(SS_HTTPRequest,Session)
    Line 127 of Director.php
    * Director::direct(/admin/assets/EditForm/field/Files/item/153/DetailForm)
    Line 127 of main.php

    Thanks
    Johannes

  • UncleCheese
    Avatar
    4085 Posts

    Re: 2.4.0 can't upload .f4v files to assets folder Link to this post

    This actually isn't a DOM issue. It looks like SS is validating file extensions in 2.4.. see File::$allowed_extensions

    It's a public variable, so you can probably just modify it with File::$allowed_extensions[] = "xxx";

  • theoldlr
    Avatar
    Community Member
    103 Posts

    Re: 2.4.0 can't upload .f4v files to assets folder Link to this post

    I'm glad I came across this... I am having the same problem uploading a file with userforms and I'd like to change the allowable extensions. Is there a way to add a wild card so that any file type could be uploaded?

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: 2.4.0 can't upload .f4v files to assets folder Link to this post

    Has anyone found a solution to this problem? My assets folders includes files in lots of different formats, e.g., .cpp, .lha, and I can't even save the folder name right now. I need to either be able to add valid file extensions, or disable extension checking for just the assets folder.

    Hans

  • theoldlr
    Avatar
    Community Member
    103 Posts

    Re: 2.4.0 can't upload .f4v files to assets folder Link to this post

    I ended up using the SWFUpload module--it didn't restrict my file types. I was using an upload field via userforms module before.

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: 2.4.0 can't upload .f4v files to assets folder Link to this post

    Switching back to the SWFUpload module wasn't appealing, so I simply added the file types that I needed to sapphire/filesystems/File.php's allowed_extensions variable.

    Hans

    1996 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.