Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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 :

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("");
I tried to modify the dirname variable in many ways, starting from the classic :
my $dirname ="../tmp/$utilisateur";
but I wasn't able to make it work

In reply to Re^2: Cgi-bin : printing .txt files by teddyttas
in thread Cgi-bin : printing .txt files by teddyttas

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (9)
    As of 2018-06-20 08:20 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (116 votes). Check out past polls.