Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to upload a file from a user's desktop to a web server?

Reply
Thread Tools

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

 
 
srini
Guest
Posts: n/a
 
      08-18-2004
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
 
Reply With Quote
 
 
 
 
Tore Aursand
Guest
Posts: n/a
 
      08-18-2004
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
File upload from client application (non-form based upload) stuart@microsoft.com Python 1 11-25-2006 12:14 AM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
How to detect sizeof upload in order to show status of browser file upload? Heather Fraser Java 0 07-05-2004 12:35 AM
Upload Excel with Macros using HTML File Upload Prakash ASP General 3 11-12-2003 04:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57