Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Unable to upload an image (SS 3.1.1)

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 309 Views
  • LoFonz
    Avatar
    Community Member
    4 Posts

    Unable to upload an image (SS 3.1.1) Link to this post

    Hi everyone, I'm having some troubles uploading a simple image on a simple page.php... I did everything I need to do, and I'm 100% sure my code is correct, but I'm still having a weird error, I enclosed a .JPG on which you can see the error, it's a JQuery error, but I can't find out why I'm getting it :/

    It looks like this is a Json error, but seriously, why? O_O

    EDIT : I'm doing this on a fresh install of the latest update of SS..

    Btw, here's the code I used to create the image, just to make sure

    private static $has_one = array(
    'Photo' => 'Image'
    );

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

    $fields->addFieldToTab("Root.Main", new UploadField('Photo'));

    return $fields;
    }

    Thank you

    Attached Files
  • LoFonz
    Avatar
    Community Member
    4 Posts

    Re: Unable to upload an image (SS 3.1.1) Link to this post

    Wow this is weird, when I change the "new UploadField('Photo')" to "new UploadField('whatever'), I don't get the error anymore (but of course, I can't upload a picture hum..).

    It doesn't make sense at all ^^'

  • LoFonz
    Avatar
    Community Member
    4 Posts

    Re: Unable to upload an image (SS 3.1.1) Link to this post

    And I don't get the error anymore if I empty my "silverstripe-cache" folder, but I still can't get the upload to work..

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