You are not logged in.
I have been able to successfully integrate Xinha into our content management system. It is working very well and everybody seems to be quite pleased.
If you are curious, we are using it post content on this site: http://www.realtruth.org
In addition, Xinha seems to be able to handle large files quite comfortably. Everything works fine. I have been able to edit and save files as large as 431KB (of HTML markup). However, when trying to POST changes to a HUGE file (1.13MB), the post itself times out.
I am using PHP to read the $_POST and write the value to the server. Basically the timeout (or something) is such that the server eventually responds by giving you a dialog box to download the PHP file itself (which is just empty), rather than actually completing the posts. It appears to take about 40 seconds from when it starts uploading.
I have already set the PHP max timeout values on both the editing page and the page I am posting to.
Specifically:
ini_set("max_input_time", 0);
ini_set("max_execution_time", 0);
set_time_limit(86400);
Does anybody have any ideas on how to increase the post timeout? For files this big I need it to be something like 10 minutes.
Thanks!
Last edited by Practicality (2007-03-16 12:05:58)
Offline
By the way, if anybody is curious, I created an AJAX uploader to handle uploading large files. I break the file into manageable chunks and send it piece by piece, thereby avoiding timeouts. Here is the code if anybody is interested (Uses jQuery, but standard method of Ajax calls would work just as well):
var arrFileUpload = new Array();
var lngTotalLength;
function Save()
{
// Validation Code
if (bolPass)
{
var strFullText = xinha_editors.txtFlatfile.getHTML();
while (strFullText.length > 10000)
{
arrFileUpload.push(strFullText.substr(0, 10000));
strFullText = strFullText.substr(10000);
}
arrFileUpload.push(strFullText);
lngTotalLength = arrFileUpload.length;
startUpload();
}
function startUpload()
{
var strFlatfile = $("#strFlatfile").val();
var strURL = "/path/to/FlatfileUpload.php";
var strChunk = arrFileUpload.shift();
var bolComplete;
var lngProduct = $("#lngProduct").val();
var lngCurrentLength = arrFileUpload.length;
if (lngCurrentLength == 0)
bolComplete = 1;
else
bolComplete = 0;
var fltComplete = ((lngTotalLength - lngCurrentLength) / lngTotalLength)*100;
var divModal=document.createElement('div');
divModal.innerHTML = 'Upload in progess. Percent Complete <span id="progress">' + fltComplete + '</span>%';
divModal.id = 'ModalDiv';
document.getElementsByTagName('body')[0].appendChild(divModal);
var strSend = "lngProduct=" + lngProduct + "&strFlatfile=" + strFlatfile + "&bolComplete=" + bolComplete + "&bolInit=1&strChunk=" + strChunk;
if (bolComplete == 0)
{
$.ajax({
type: "POST",
url: strURL,
data: strSend,
success: continueUpload
});
}
else
{
$.ajax({
type: "POST",
url: strURL,
data: strSend,
success: finishUpload
});
}
}
function continueUpload(bolSuccess)
{
if (bolSuccess != 1)
alert('There was a problem uploading (' + bolSuccess + ') You may want to check if the network connection is still live.');
else
{
var strFlatfile = $("#strFlatfile").val();
var strURL = "/Path/To/FlatfileUpload.php";
var strChunk = escape(arrFileUpload.shift());
var bolComplete;
var lngProduct = $("#lngProduct").val();
var lngCurrentLength = arrFileUpload.length;
if (lngCurrentLength == 0)
bolComplete = 1;
else
bolComplete = 0;
var fltComplete = ((lngTotalLength - lngCurrentLength) / lngTotalLength)*100;
$("#progress").html(fltComplete);
var strSend = "lngProduct=" + lngProduct + "&strFlatfile=" + strFlatfile + "&bolComplete=" + bolComplete + "&bolInit=0&strChunk=" + strChunk;
if (bolComplete==0)
{
$.ajax({
type: "POST",
url: strURL,
data: strSend,
success: continueUpload
});
}
else
{
$.ajax({
type: "POST",
url: strURL,
data: strSend,
success: finishUpload
});
}
}
}
function finishUpload(strURL)
{
window.location.replace(strURL);
}
Last edited by Practicality (2007-09-10 11:49:03)
Offline