Gossamer Forum
Home : General : Perl Programming :

CGI-Lite and MACs - problem uploading files

Quote Reply
CGI-Lite and MACs - problem uploading files
I'm using the CGI-Lite module for a file-uploading script. MAC users have problems with this ... they're getting the "no file selected' error messages.

I believe the problem has to do with how paths are defined in the MAC (Unix isn't understanding how to read it, I presume), but have no clue what the fix is.

Can anyone help me out, or point me in the right direction to a good FAQ or anything that covers this?

TIA,
Pam
Quote Reply
Re: [durp] CGI-Lite and MACs - problem uploading files In reply to
There shouldn't be a problem. I've had a mac user test out an upload form in one of my scripts fairly recently and the following works ok:

Code:
use CGI qw:/standard/;

my $file = param('file_field');

open NEW, '>', $some_path or die $!;
binmode NEW;
while (<$file>) {
print NEW;
}
close NEW;

Of course you'd do safety checking etc, that is just an example.