Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
A user there shows you can use a my $file = <FH> to get the contents of a file to transport into the database.
How would you do this from an upload form without first shoving the file onto your web server, reading the contents, pushing it into the database and finally deleted the uploaded file from the server?
The above fails and I'm not sure why. When you print $uploadfile originally you get the entire C:\\path\to\file\name.file . That goes without saying but when you open it, is it really trying to open from this location? I expected it to be in memory already but something somewhere isn't right.my $uploadfile = param('upload'); open(FILE, "$uploadfile") or die "error: $!"; my $source = <FILE>; close (FILE);
Is there a way to do this without first saving the file to the disk?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File source from memory
by Tanktalus (Canon) on Feb 18, 2005 at 18:03 UTC | |
by Anonymous Monk on Feb 18, 2005 at 18:37 UTC | |
|
Re: File source from memory
by maard (Pilgrim) on Feb 18, 2005 at 19:07 UTC | |
by Anonymous Monk on Feb 18, 2005 at 19:16 UTC | |
by zentara (Cardinal) on Feb 19, 2005 at 13:27 UTC |