0

I'm using SilverStripe 4.

When I try to drag and drop a file into the SilverStripe upload field in the CMS, I get the following error:

File already exists at path: fundraising/c573871f03/DSCN9695-v2.JPG

I get the same error when I click on 'Browse' and add the file that way.

If a click on 'Add From Files'(inside the upload field) and then drag an image into the screen that appears, it will upload successfully. I can then click on 'insert' and publish the article with no problem. It's only dragging and dropping that doesn't want.

Below is my model

SectionChild.php

ennamespace {

use SilverStripe\AssetAdmin\Forms\UploadField;
use SilverStripe\Assets\Image;

class SectionChild extends Page {

    private static $has_one = [
        "HeaderImage" => Image::class
    ] ;

    private static $owns = [
        "HeaderImage"
    ];

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

        $fields->addFieldToTab('Root.Main', $headerImage = new UploadField('HeaderImage'), 'Content');
        $headerImage->setFolderName($this->Title);

        return $fields;
    }

}
class SectionChildController extends PageController {

}

}

Thank you so much in advance!

1 Answers1

0

I found out what was wrong. I was exceeding the memory limit of my server. I edited my user.php to the following:

upload_max_filesize = 15M
post_max_size = 20M
max_execution_time = 300
memory_limit = 256M

Although I'm still worried that I've had to increase the memory limit to 256M. 200M wasn't even enough..