GETTING STARTED IMPORTING FROM FILE

1. In a XHTML document/page insert a standard file upload code block

eg as in /scripts/1blankspace.master.001.js

2. To create the import record to hold the file attachment using:

/ondemand/setup/?method=SETUP_IMPORT_MANAGE
3. In XHTML document using js/jQuery, set id="OnDemandFileUploadObjectID" value to the ID returned in step 2.
4. Call standard function to import the file eg onDemandFileUpload();
Now file is attached to import record in the mydigitalstructure space.

5. To get data in file use: /ondemand/core/?method=CORE_ATTACHMENT_READ&rf=XML&object=29&objectcontext=[import ID - from above]&convert=1

This is assuming file is CSV and want back as XML - hence the &convert=1.

If you attached a file that was already XML or JSON - then leave off the &convert=1.

If the file is delimited other than "," then add &split= eg &split=|

You will then get XML back with each column represented as XML field - column1, column2 etc

6. You can then loop through, doing and logic required and build up _MANAGE request send POST to onDemand eg CONTACT_PERSON_MANAGE.