0
我正在使用Cgicc構建一個簡單的CGI應用程序。我想在我的網頁中嵌入的圖像,但是,這是一個使用Cgicc嵌入圖像-cgi認爲圖像是腳本
[email protected]:~/www$ python -m CGIHTTPSever
C++代碼
從CGI127.0.0.1 - - [15/Nov/2014 13:26:52] code 403, message CGI script is not executable ('/cgi-bin/tmp3.jpg')
我調用CGI Server實例返回的錯誤
#include <iostream>
#include <sstream>
#include <string>
#include <unistd.h>
#include <fstream>
#include <stdlib.h>
#include "cgicc/Cgicc.h"
#include "cgicc/HTTPHTMLHeader.h"
#include "cgicc/CgiDefs.h"
#include "cgicc/Cgicc.h"
#include "cgicc/HTTPHTMLHeader.h"
#include "cgicc/HTMLClasses.h"
#define cimg_display 0
#include "CImg.h"
using namespace std;
using namespace cgicc;
int main(int argc, char **argv){
try{
Cgicc formData;
cout << HTTPHTMLHeader()<<endl;
cout << HTMLDoctype(HTMLDoctype::eStrict)<<endl;
// Set up the HTML document
cout << html() << head() << title("Cgicc example") << head() << endl;
cout << body().set("bgcolor","#cccccc").set("text","#000000").set("link","#0000ff").set("vlink","#000080") << endl;
cout << img().set("src", "tmp3.jpg").set("height", "100").set("width", "100");
cout << "<form method=\"GET\" action=\"formProcessor.cgi\">"<<endl;
cout << h2("Input picure info") <<endl;
cout << p("Height")<<endl;
cout << "<input type=\"text\" name=\"height\"> <br>"<<endl;
cout << p("Width");
cout << "<input type=\"text\" name=\"width\"> <br>"<<endl;
cout << "<input type=\"submit\" value=\"Submit\">"<<endl;
cout << "</form>"<<endl;
}catch(exception& e){
cout <<"Error"<<endl;
}
return 0;
}
有沒有人知道這個問題的解決方案?我一直無法找到關於這個問題的網上很多..