]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
4 * CGI test program for CUPS.
6 * Copyright 2007-2014 by Apple Inc.
7 * Copyright 1997-2005 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
17 * Include necessary headers...
24 * 'main()' - Test the CGI code.
27 int /* O - Exit status */
31 * Test file upload/multi-part submissions...
34 freopen("multipart.dat", "rb", stdin
);
36 putenv("CONTENT_TYPE=multipart/form-data; "
37 "boundary=---------------------------1977426492562745908748943111");
38 putenv("REQUEST_METHOD=POST");
40 printf("cgiInitialize: ");
43 const cgi_file_t
*file
; /* Upload file */
45 if ((file
= cgiGetFile()) != NULL
)
48 printf(" tempfile=\"%s\"\n", file
->tempfile
);
49 printf(" name=\"%s\"\n", file
->name
);
50 printf(" filename=\"%s\"\n", file
->filename
);
51 printf(" mimetype=\"%s\"\n", file
->mimetype
);
54 puts("FAIL (no file!)");
60 * Return with no errors...