View more context



Hey friends..i'm trying to add an upload field that will allow my client to upload a csv into the CMS, and then i'm trying to run an onAfterWrite to load the csv into the system using the csvbulkloader...I have that all working...but I can't seem to be able to grab the URL of the file that is uploaded from within the onAfterWrite function....can someone help?

    `$uploadField = UploadField::create('LocationCSV','Upload CSV of Locations');`


`public function onAfterWrite(){`



Undefined property: SiteConfig_Extension::$LocationCSV


so you have a File Relation called LocationCSV on siteconfig ?


alright so update...i was able to figure it out, I just had to access the ID of the file via $this->owner->LocationCSVID


and then run a get on the object for the file itself


now the issue i've run into is with the bulkloader itself


I have the file uploaded into the assets directory, and although the loader works fine if the csv is in the root of the site, for some reason when it is in the assets directory, the cms instance stalls up on save


How can we get data from DataList Object in template?