Upload file without using the filepicker

Upload file without using the filepicker

дэргэд Joshua Gang -
Хариу нийтлэлийн тоо: 4
Background info. We are moving from a third party CMS to moodle. At this point in time we provide all user/course/enrollments to the thirdpaty CMS. In trying to make the Moodle transition as seemless/painless as possible, we are going to try to mimic what we are doing with the third party CMS. So via a cron job we are trying to populate all user/course/enrollment via CSV files. I am trying to get a file into moodle but it seems that everything (at least the objects written in Moodle 2.0) related to file uploads deal with the filepicker object. Can anybody point me into the right direction to be able to upload a file into moodle, ie into the moodledata folder as well as the correct entry into the moodle database. Thanks
Үнэлгээний дундаж: -
Joshua Gang-н хариуд

Re: Upload file without using the filepicker

дэргэд Mary Cooch -
Documentation writers зураг Moodle HQ зураг Particularly helpful Moodlers зураг Testers зураг Translators зураг
Hi there
Could you give a clearer example of what you want to do please? On the one hand you are saying in Moodle 2.0 you have to upload via the filepicker but on the other hand you are talking about CSV upload. If you simply want to upload users into Moodle via a CSV file then this is done in Moodle 2.0 via site administration>users>accounts>upload users.
Mary Cooch-н хариуд

Re: Upload file without using the filepicker

дэргэд Joshua Gang -
I am talking about a CSV but upload I guess is a misleading term. I need this to be a behind the scenes cron job not a manual process of using the webpage. And so far everything I have seen in Moodle in getting a file into the moodle data directory as well as the correct row in the database is by using the filepicker object within the server/moodle/repository folder. So my final project would be using SSIS to generate a csv file with all of the users information and then having a cron job read through the file and import/update the user information. I was planning on using the uploaduser.php code (with the reference to the uploaduser_form.php) to read through the csv file and insert new or update existing users.
Joshua Gang-н хариуд

Re: Upload file without using the filepicker

дэргэд Dale Davies -
Rather than attempting to automate an upload it into Moodle using the file API. Could you either save the csv file into a network share accessible by the Moodle web server and read the file in from there using PHP. Or use cURL to read the file from a remote URL, and parse the contents into something usable by the uploaduser.php script.