in reply to Re: Cgi-bin : printing .txt files
in thread Cgi-bin : printing .txt files
Sorry, I've been doing some other projects and I've a little forgot this subject for a while.
what I would like to add to my site is the possibility to save projects in a file in order to let the user download a zip (I'm watching the package Archive::Zip in order to do this), when they are done (My site is an attempt to make object oriented programmation easier. The result of the user's work on the site should be a number of pm files to download)
I can create a temporary directory on the server, but I only get to create it on the cgi-bin dir.
I would like to create it on the public html dir, cause in cgi-bin, as a txt file is a non-executable file, it doesn't let me show the content on the browser. I would like to be able to do that to so that the user could check the files he is creating while working.
When I try to do this locally, there is no problem, but on the server I can't acces the cgi-bin's upper folder and create there my temporary dir to store the txt files.
It's the first time I try to run a script on a server, so please, be patient :)
When I'll be done with this project I hope I'll be able to return something useful to the community.
P.S. : here is the part of the script that creates me the tmp dir on the cgi-bin :
I tried to modify the dirname variable in many ways, starting from the classic :my $dirname ="tmp/$utilisateur"; mkdir("$dirname"); open FILE, ">", "$dirname/file.txt" or die $!; foreach my $key ($q->param()) { print FILE $key . " " . $q->param($key) . "\n"; } close FILE; return $self->redirect("http://perlmonks.org");
but I wasn't able to make it workmy $dirname ="../tmp/$utilisateur";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Cgi-bin : printing .txt files
by kennethk (Abbot) on Jan 07, 2013 at 15:07 UTC | |
by Anonymous Monk on Jan 07, 2013 at 20:05 UTC |