[eluser]Robert May[/eluser]
Is there any way to use AJAX with CI without creating massive loads on the server? I thought my code was reasonable, but it's taking up a huge amount of memory to perform. Basically, as files are uploaded with Uploadify, I want to add the entry to the database. Uploading the files is fine, but once I made it perform another AJAX command after each item had been uploaded, sending data through CI, it got far worse.
Any ideas on what I could do to still pass this through CI without the overhead? Or should I just create a separate database management script for use with jQuery?
This is the bit that kills the script, and it only happens when it uses CI:
Code:
$('#fileInput').fileUpload({
'uploader':'/flash/uploader.swf',
'script':'/imayges/system/application/controllers/upload.php',
'cancelImg':'/images/cancel.png',
'folder':'/gallery',
'multi':true,
'wmode':'transparent',
onComplete: function (evt, queueID, fileObj, response, data) {
$.post("/imayges/index.php/admin/gallery/upload/", {newFileName: response}, function(id){
$("#gallery_admin_right_column_inner").append('<div class="gallery_admin_upload_image_container"><ul class="gallery_admin_image_list"><li class="gallery_admin_image_list_title"><div class="editable" id="'+id+'_imagename">Image Name</div></li><li><div style="width:200px;height:200px;"></div></li><li>'+id+'</li><li><input type="text" id=""</li><li>Edit details</li><li>Edit details</li><li><input type="checkbox"></li></ul></div>');
});
},