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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Upload and process file in admin interface


Go to End


2 Posts   1511 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 "creating a module" 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