File Upload Using CGI

2004-12-01 Thread Manas Kulkarni
Hey All !
I know this is not the place to ask cgi doubts but since cgi is just a
small part of my work, I had subscribed to only this list. 
Anyways, I am writing a perl-cgi script which will accept a file from
the user through an HTML form and the script will write this file on the
server side. This is what I have done so far:

This is a line from my form
Upload File:


And this is a snippet from my script:
%in = $query->Vars; # get the form data into a hash

foreach $key(keys %in) {
 if($key eq 'sequences') {
$file_data = $in{$key};
 }
}

open(SEQ,">/home/web/insequences");
print SEQ $file_data;
close SEQ;

When I open my server side file all I see is the key (sequences).
I think I had read somewhere that if you submit a form using an input
type file, then the file contents are read into that particular field.
Where am I going wrong or is there any other decent way of doing this ?

Thanks beforehand,
Manas.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Addition to doubt: File Upload using CGI

2004-12-01 Thread Manas Kulkarni
Hi,
I made a slight mistake in my previous post. I am not getting the key
value, I am getting the name of the file instead(not the absolute path).

Thanks,
Manas.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: File Upload Using CGI

2004-12-01 Thread Manas Kulkarni
OK. Advice taken. I have a moustache and I definitely don't wear diapers ;)

Thanks a lot,
Manas.


Quoting "JupiterHost.Net" <[EMAIL PROTECTED]>:

> 
> 
> Charles K. Clarkson wrote:
> 
> > Manas Kulkarni <[EMAIL PROTECTED]> wrote:
> > 
> > : %in = $query->Vars; # get the form data into a hash
> > : 
> > : foreach $key(keys %in) {
> > :  if($key eq 'sequences') {
> > :   $file_data = $in{$key};
> > :  }
> > : }
> > 
> >Arrgh! I have never understood the desire to immediately 
> > place all parameters in a hash. This replaces all that.
> 
> 
> I hear ya!
> 
> Left overs from the old cgi-lib days when it was all pput in %FORM or
> 
> %IN or something like that :)
> 
> It is much wiser to use CGI for param() and upload() and not
> reverting 
> back to ancient ways :)
> 
> Like growing your first mustache but still wearing diapers ;p
> You can do it if you want but its a bit odd :)
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: File Upload Using CGI

2004-12-02 Thread Manas Kulkarni
OK Guys I tried using the upload method of CGI. Here is what I did:

my $upload = CGI::Upload->new;

*Do I need to associate the upload variable with the CGI object in some
way which I am creating in the cgi script to accept the other parameters
from the html form ?


perl script to binary executible

2005-01-24 Thread Manas Kulkarni
Hi,

I would like to convert my perl script into a binary executable before 
deploying it on a client machine

I checked on google and found "perlbin" at sourceforge.net but that 
does not seem to work. It gives compilation error with handy.h file 
which is the perl distribution file.

Is there a way to convert perl script to binary executable (linux 
platform) so that the code is not seen by the client ?

Thanks in Advance for the help

Manas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]