Extension talk:UploadCSV

Excellent! How far away do you think this extension is before ready? I was about to write exactly this same functionality but thought I better check what's available ;-) I was going to use it to importing spreadsheet information with time information added using Extension:When so that DPL queries could be used to select by account and time period etc. --Nad 11:40, 1 May 2007 (UTC)
 * Could the delimeter used be a global variable instead of fixed to semicolon? --Nad 11:46, 1 May 2007 (UTC)
 * Hi Nad, actually it is working, so I will supply a link with the source code these days. --GunterS 18:00, 2 May 2007 (UTC)
 * Excellent! thanks a lot ;-) --Nad 21:49, 2 May 2007 (UTC)

List of changes I've made
I'm testing it at www.wikifs.org/Special:UploadCSV, here's a list of the changes I've made during the process of getting it to function and also some extra features:
 * (diff) Need to use $wgRequest->getFileTempname to access uploaded data
 * (diff) Form needs enctype="multipart/form-data" for data to be uploaded
 * (diff) File reads were reading 4096 bytes, changed from fgets to fscanf to read one text-line at a time (not quite working yet)
 * (diff) Changed the template text-input into a dropdown list of all the templates
 * (diff) Allow separator to be set in form, also allows escaping separator in content (e.g. \;).
 * I noticed the header file-read was also getting 4096 bytes, so changed to read a single line
 * I also temporarily changed the form here, but it's chanegd back again now
 * (diff) Removed the update of the client-side form info from inside main row-processing loop
 * (diff) Made loop process from start-line to end-line and then update the form ready for another block of same size
 * (diff) The tmp file needs to be moved if we want to continue processing it without re-uploading (currently the moved files are not deleted)
 * (diff) Moved upload button into second column of table
 * (diff) Simplified main work loop: LoadTemplate seems redundant.
 * (diff) Changed back to fgets, omitting second parameter reads a single line (since PHP4.3)

Problems

 * Uploaded files are never deleted currently - maybe add an expiry time?