]>
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 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * Include necessary headers...
22 * 'main()' - Test the CGI code.
25 int /* O - Exit status */
29 * Test file upload/multi-part submissions...
32 freopen("multipart.dat", "rb", stdin
);
34 putenv("CONTENT_TYPE=multipart/form-data; "
35 "boundary=---------------------------1977426492562745908748943111");
36 putenv("REQUEST_METHOD=POST");
38 printf("cgiInitialize: ");
41 const cgi_file_t
*file
; /* Upload file */
43 if ((file
= cgiGetFile()) != NULL
)
46 printf(" tempfile=\"%s\"\n", file
->tempfile
);
47 printf(" name=\"%s\"\n", file
->name
);
48 printf(" filename=\"%s\"\n", file
->filename
);
49 printf(" mimetype=\"%s\"\n", file
->mimetype
);
52 puts("FAIL (no file!)");
58 * Return with no errors...