Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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("http://perlmonks.org");
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

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (14)
    As of 2014-11-25 21:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (158 votes), past polls