Sorry if I haven't understood you well.

Let me explain you the concept of what I think that you have said:

to upload something from any PC to a server there is a lot of magic!

Basicaly, you need someone asking for a file from the server.

And another one, pushing a file from the user's PC.

To do this, you need more than an HTML form.

That is just speaking. But you must also do something to make it happen.

That is where perl comes as an agent from the server part.

You don't need to have perl in the users part. Just the HTML form would do that part by fetching the file.

After submiting the form, you need perl to handle the data being transfered. It has to read that data and write the file's content to the directory that you chose.

# open a new file and transfer bit by bit from what's in the buffer open( SAVED, ">>$localfile" ); # || die $!; while ( $bytesread = read( $remotefile, $buffer, 1024 ) ) { print SAVED $buffer; } close SAVED;
So your form called the perl script that you wrote and left at the server's /cgi-bin/ directory.

That script read all the ulpoaded file and wrote it bit by bit on the directory that you chose.

Now you need to finish the script and show the image in some new html page.

To get your script be more than words written in a file, you need to have perl installed at the same location that you declared at the first line of your cgi script.

You could know that it is correct if you see that perl is in the folder /usr/bin/ . If not, you could change that starting text with the name of the directory where Perl resides...

At the command promp you should write:where perl And what you read as an answer is what you should copy at line 1

You should read a complete book and try some examples until you get all the idea: http://sunsite.iisc.ernet.in/virlib/perl/example/ewtoc.html .


In reply to Re: Cgi pm and photo uploads by chanio
in thread Cgi pm and photo uploads by julieowen24

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!
  • 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, details, 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, summary, 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.