How to upload a file from a user's desktop to a web server?

Discussion in 'Perl Misc' started by srini, Aug 18, 2004.

  1. srini

    srini Guest

    Hi all,

    I am writing a HTML/CGI perl script to attach a file from a HTML
    submit form and to store that attachment in a tmeporary variable on
    the web server that hosts the perl script.

    snippet of code:

    HTML part:
    ---------------
    <tr><td colspan="2"> <FONT color=black>Attachment (if any):</FONT><BR>
    <INPUT type="file" size=50 name="attachedfile" ALLOW="text/*">
    </td></tr>
    --------------


    Perl code:
    -----------------------------------------------
    $attachedFile = $query -> param ("attachedfile");
    # $attachedFile =~ s/\\/\\\\/g;
    ------------------------------------------------

    Now I want to capture the file attachment from a user's desktop and
    upload it into a temp variable on the web server. I tired to use
    fielfield() and tmpFileName() functions, but in vain.

    Can some boby kindly tell me how my perl code should be modified so
    that I can store the $attachedFile in to $temp variable on the web
    server?

    Thanks in advance,
    Srini
    srini, Aug 18, 2004
    #1
    1. Advertising

  2. srini

    Tore Aursand Guest

    On Wed, 18 Aug 2004 07:02:36 -0700, srini wrote:
    > Can some boby kindly tell me how my perl code should be modified so that
    > I can store the $attachedFile in to $temp variable on the web server?


    Read the documentation for the CGI.pm module. You could also do a search
    on this group (using Google). This question has been answered multiple
    times in the past.


    --
    Tore Aursand <>
    "What we do is never understood, but only praised and blamed."
    (Friedrich Nietzsche)
    Tore Aursand, Aug 18, 2004
    #2
    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. TC
    Replies:
    4
    Views:
    639
    JohnnyAppleseed
    Feb 7, 2005
  2. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,416
    Bruce Barker
    Aug 3, 2005
  3. Bjoern
    Replies:
    7
    Views:
    314
    Alan J. Flavell
    Oct 14, 2003
  4. Replies:
    3
    Views:
    78
    Paul Lalli
    Oct 19, 2005
  5. iMath
    Replies:
    7
    Views:
    934
    iMath
    Nov 10, 2013
Loading...

Share This Page