Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Upload and process file in admin interface


Reply


2 Posts   1145 Views

Avatar
craesh

Community Member, 25 Posts

16 June 2010 at 2:49am

Hi!

I need to upload a file in the admin interface and process it afterwards, without saving it. It's a XML file that contains some fields to create new DataObjects. Ok, so I'll need a FileField in my getCMSFields(), but how do I tell it to call a given method of my Page to process the file there?

In addition, I'll need a way to display some feedback - whether the file has been imported successfully or there have been some errors.

Thanks!
craesh

Avatar
craesh

Community Member, 25 Posts

18 June 2010 at 1:58am

Since there haven't been any comments y will talk about my current approach:

I've found the "[url=http://doc.silverstripe.org/private:tutorial:creating-a-module]creating a module[/url]" tutorial and have started my work based on it. I've added a button "upload new xml file" to the left panel that leads me to a form to upload a new file - ok, it should, I'm currently facing a "javascript parsing error". It seams to be more convenient to have the upload form in a separate module rather than in a Page object and doing the processing in the onBeforeWrite method.

Greetings
craesh