We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`#include <fcgi_stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h>
int main(void) { int count = 1; while(FCGI_Accept() >= 0) { char *contentLength = getenv("CONTENT_LENGTH"); int len; if (contentLength != NULL) { len = strtol(contentLength, NULL, 10); } else { len = 0; } printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello!</title>" "
printf("<br />CONTENT_LENGTH = %d <br />\r\n", len); printf("<form enctype='multipart/form-data' method='post' action='?'><input type='text' name='text1' /><input type='file' name='file1'/><input type='submit' /></form>"); printf("<hr />"); fflush(stdout); char *rawBuffer = (char*)malloc(sizeof(char [len])); FCGI_fread(rawBuffer, len, 1, FCGI_stdin); FILE * fileOut = fopen("/tmp/fcgi.out", "a"); fprintf(fileOut, "%s", rawBuffer); fclose(fileOut); FCGI_Finish(); }
} ` Could you explain, please, why this code did not write to the fcgi.out file?
The text was updated successfully, but these errors were encountered:
your seem to not be good... you execute every time the read from stdin.... normaly you need to have if that print the form or read the stdin...
Sorry, something went wrong.
No branches or pull requests
`#include <fcgi_stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
int main(void)
{
int count = 1;
while(FCGI_Accept() >= 0) {
char *contentLength = getenv("CONTENT_LENGTH");
int len;
if (contentLength != NULL) {
len = strtol(contentLength, NULL, 10);
}
else {
len = 0;
}
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"
FastCGI Hello!
""Request number %d running on host %s\n",
count++, getenv("SERVER_NAME"));
}
`
Could you explain, please, why this code did not write to the fcgi.out file?
The text was updated successfully, but these errors were encountered: