saving files

View: New views
2 Messages — Rating Filter:   Alert me  

saving files

by Ashish Chawla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am having trouble saving files using cgicc
when i run the file through the terminal, it creates the files, but when i run through a web interface, it does everything except creating the file

here is my code for a test file

#include <iostream>
#include <fstream>
#include <string>
#include "cgicc/Cgicc.h"
#include "cgicc/CgiDefs.h"
#include "cgicc/HTTPHTMLHeader.h"
#include "cgicc/HTMLClasses.h"
#include "stdio.h"


using namespace cgicc;
using namespace std;


int main(int argc, char* argv[])
{
   
    cout << HTTPHTMLHeader() << endl;
    cout<< "<html><head></head><body>" <<endl;
   
    cout<<"creating file test"<<endl;   
    ofstream Students("test.txt");
        Students << "some" << "\n" << "name"<< "\n";
 
    cout << "</body><html>" <<endl;
    return 0;
}



_______________________________________________
help-cgicc mailing list
help-cgicc@...
http://lists.gnu.org/mailman/listinfo/help-cgicc

Re: saving files

by Russell Kliese :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ashish Chawla wrote:
> Hi,
>
> I am having trouble saving files using cgicc
> when i run the file through the terminal, it creates the files, but
> when i run through a web interface, it does everything except creating
> the file

My first guess is that it's a permissions problem. The web server
probably doesn't have permission to create the file. You could verify
this by seeing if the ofstream was created successfully.

Russell


_______________________________________________
help-cgicc mailing list
help-cgicc@...
http://lists.gnu.org/mailman/listinfo/help-cgicc