]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
2 * CGI test program for CUPS.
4 * Copyright 2007-2014 by Apple Inc.
5 * Copyright 1997-2005 by Easy Software Products.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
11 * Include necessary headers...
18 * 'main()' - Test the CGI code.
21 int /* O - Exit status */
25 * Test file upload/multi-part submissions...
28 freopen("multipart.dat", "rb", stdin
);
30 putenv("CONTENT_TYPE=multipart/form-data; "
31 "boundary=---------------------------1977426492562745908748943111");
32 putenv("REQUEST_METHOD=POST");
34 printf("cgiInitialize: ");
37 const cgi_file_t
*file
; /* Upload file */
39 if ((file
= cgiGetFile()) != NULL
)
42 printf(" tempfile=\"%s\"\n", file
->tempfile
);
43 printf(" name=\"%s\"\n", file
->name
);
44 printf(" filename=\"%s\"\n", file
->filename
);
45 printf(" mimetype=\"%s\"\n", file
->mimetype
);
48 puts("FAIL (no file!)");
54 * Return with no errors...