Any one here used C based CGI??
I have this server side code :
while (cgiFormFileRead(file, b, sizeof(b), &got_count) == cgiFormSuccess)
{
fwrite(b,sizeof(char),got_count,output);
i++;
if(i == inc && j<=100)
{
fprintf(fptr, "%d" ,j);
fseek(fptr, 0, SEEK_SET);*/
i = 0;
fflush(fptr);
j++;
}
}
I am reading this file in Ajax to display a progress bar. However, the CGI doesn't start writing as expected in above code. Instead, may be after its done with all other stuff. Or may be it is not available to other process until it has finished writing the whole file or may be finished executing the whole program.