]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f2d18633 | 2 | * "$Id$" |
ef416fc2 | 3 | * |
7e86f2f6 | 4 | * CGI test program for CUPS. |
ef416fc2 | 5 | * |
7e86f2f6 MS |
6 | * Copyright 2007-2014 by Apple Inc. |
7 | * Copyright 1997-2005 by Easy Software Products. | |
ef416fc2 | 8 | * |
7e86f2f6 MS |
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/". | |
ef416fc2 | 14 | */ |
15 | ||
16 | /* | |
17 | * Include necessary headers... | |
18 | */ | |
19 | ||
20 | #include "cgi.h" | |
21 | ||
22 | ||
23 | /* | |
24 | * 'main()' - Test the CGI code. | |
25 | */ | |
26 | ||
27 | int /* O - Exit status */ | |
7e86f2f6 | 28 | main(void) |
ef416fc2 | 29 | { |
30 | /* | |
31 | * Test file upload/multi-part submissions... | |
32 | */ | |
33 | ||
34 | freopen("multipart.dat", "rb", stdin); | |
35 | ||
36 | putenv("CONTENT_TYPE=multipart/form-data; " | |
37 | "boundary=---------------------------1977426492562745908748943111"); | |
38 | putenv("REQUEST_METHOD=POST"); | |
39 | ||
40 | printf("cgiInitialize: "); | |
41 | if (cgiInitialize()) | |
42 | { | |
43 | const cgi_file_t *file; /* Upload file */ | |
44 | ||
45 | if ((file = cgiGetFile()) != NULL) | |
46 | { | |
47 | puts("PASS"); | |
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); | |
52 | } | |
53 | else | |
54 | puts("FAIL (no file!)"); | |
55 | } | |
56 | else | |
57 | puts("FAIL (init)"); | |
321d8d57 | 58 | |
ef416fc2 | 59 | /* |
60 | * Return with no errors... | |
61 | */ | |
62 | ||
63 | return (0); | |
64 | } | |
65 | ||
66 | ||
67 | /* | |
f2d18633 | 68 | * End of "$Id$". |
ef416fc2 | 69 | */ |