]>
git.ipfire.org Git - thirdparty/cups.git/blob - cgi-bin/testcgi.c
836a237c535ce3ea69301ef1d4a666e94324a2b2
2 * CGI test program for CUPS.
4 * Copyright © 2020-2024 by OpenPrinting.
5 * Copyright © 2007-2014 by Apple Inc.
6 * Copyright © 1997-2005 by Easy Software Products.
8 * Licensed under Apache License v2.0. See the file "LICENSE" for more
13 * Include necessary headers...
20 * 'main()' - Test the CGI code.
23 int /* O - Exit status */
27 * Test file upload/multi-part submissions...
30 freopen("multipart.dat", "rb", stdin
);
32 putenv("CONTENT_TYPE=multipart/form-data; "
33 "boundary=---------------------------1977426492562745908748943111");
34 putenv("REQUEST_METHOD=POST");
36 printf("cgiInitialize: ");
39 const cgi_file_t
*file
; /* Upload file */
41 if ((file
= cgiGetFile()) != NULL
)
44 printf(" tempfile=\"%s\"\n", file
->tempfile
);
45 printf(" name=\"%s\"\n", file
->name
);
46 printf(" filename=\"%s\"\n", file
->filename
);
47 printf(" mimetype=\"%s\"\n", file
->mimetype
);
50 puts("FAIL (no file!)");
56 * Return with no errors...