upload file with perl cgi

Discussion in 'Perl Misc' started by Sokar, May 10, 2004.

  1. Sokar

    Sokar Guest

    I am designing a new feature to a services web page for the user to upload
    screen dumps of problems onto my server for inspection and maybe further
    use.

    I have investigated the <input TYPE='file' NAME='pic' size='15'> for use in
    the html part.

    The problem comes when I get to the perl cgi part of the code, I am havin
    problems saving the .jpg onto my server.

    Can anyone provide a little help on how to upload files onto the server via
    a web interface?

    Thanks

    John
    Sokar, May 10, 2004
    #1
    1. Advertising

  2. (Sokar) writes:

    > I am designing a new feature to a services web page for the user to upload
    > screen dumps of problems onto my server for inspection and maybe further
    > use.
    >
    > I have investigated the <input TYPE='file' NAME='pic' size='15'> for use in
    > the html part.


    What was the outcome of the investigation?

    > The problem comes when I get to the perl cgi part of the code, I am havin
    > problems saving the .jpg onto my server.


    What sort of problems? (Random shot-in-the-dark: did you forget binmode()?).

    > Can anyone provide a little help on how to upload files onto the server via
    > a web interface?


    perldoc CGI

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley, May 10, 2004
    #2
    1. Advertising

  3. Sokar

    Tore Aursand Guest

    On Mon, 10 May 2004 04:04:37 -0700, Sokar wrote:
    > Can anyone provide a little help on how to upload files onto the server
    > via a web interface?


    perldoc CGI


    --
    Tore Aursand <>
    "When you love someone, all your saved-up wishes start coming out."
    (Elizabeth Bowen)
    Tore Aursand, May 10, 2004
    #3
  4. (Sokar) wrote in
    news::

    > I am designing a new feature to a services web page for the user to
    > upload screen dumps of problems onto my server for inspection and
    > maybe further use.
    >
    > I have investigated the <input TYPE='file' NAME='pic' size='15'> for
    > use in the html part.
    >
    > The problem comes when I get to the perl cgi part of the code, I am
    > havin problems saving the .jpg onto my server.
    >
    > Can anyone provide a little help on how to upload files onto the
    > server via a web interface?


    <http://tinyurl.com/3byux> (http://search.cpan.org/~lds/CGI.pm-
    3.05/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD)

    <http://www.catb.org/~esr/faqs/smart-questions.html>
    --
    A. Sinan Unur
    (reverse each component for email address)
    A. Sinan Unur, May 10, 2004
    #4
  5. Sokar

    Sean Berry Guest

    I do a file upload in part of a script I wrote.

    This is the code for the input field:
    <input type="file" name="filename" size=40 maxlength=64 accept="pdf/*">

    Then, in an upload subroutine I do something like this:
    $pdfdir = "/admin/ppv_pdfs";
    $x = file_upload($filename, $pdfdir);

    You don't need to do "$x =" if all you do is upload the file. But, if you
    can use the return value then it could be helpful as well.





    "Sokar" <> wrote in message
    news:...
    > I am designing a new feature to a services web page for the user to upload
    > screen dumps of problems onto my server for inspection and maybe further
    > use.
    >
    > I have investigated the <input TYPE='file' NAME='pic' size='15'> for use

    in
    > the html part.
    >
    > The problem comes when I get to the perl cgi part of the code, I am havin
    > problems saving the .jpg onto my server.
    >
    > Can anyone provide a little help on how to upload files onto the server

    via
    > a web interface?
    >
    > Thanks
    >
    > John
    Sean Berry, May 11, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lionel Valero

    perl CGI file upload memory leak

    Lionel Valero, Nov 11, 2003, in forum: Perl Misc
    Replies:
    11
    Views:
    287
    Lionel Valero
    Nov 12, 2003
  2. Avin Patel
    Replies:
    4
    Views:
    917
    Brian McCauley
    Nov 5, 2004
  3. Jerome

    Perl/CGI file upload

    Jerome, Mar 20, 2007, in forum: Perl Misc
    Replies:
    7
    Views:
    188
    Gunnar Hjalmarsson
    Mar 21, 2007
  4. Jerome

    Perl/CGI file upload

    Jerome, Mar 20, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    118
    Jerome
    Mar 20, 2007
  5. kath
    Replies:
    4
    Views:
    522
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page