Re: how to write content of file to an array / variable ?

2006-07-28 Thread Michael Gale
Hello, Here is what I currently do to accept file uploads from users via http: #!/usr/bin/perl -w use CGI; $upload_dir = /tmp; $query = new CGI; $filename = $query-param(fname); $filename =~ s/.*[\/\\](.*)/$1/; ## $upload_filehandle = $query-upload(fupload); if ( $filename =~

RE: how to write content of file to an array / variable ?

2006-07-27 Thread Jeff Peng
my $file = $q-param('file'); Are you sure the $file exist on your system actually? open (FOO, temp1); Under CGI,you maybe always need to specify a full path to the file.Maybe you would write: open Foo,/your/path/temp1 or die $!; while ($file) Before reading,you should open the $file