--- [EMAIL PROTECTED] wrote: > okay this is what i have so far > > this will upload text files fine and out put the text to the screen as well > as save it to the file name i give it, but i need it to work with images as > well can somebody show me how this can be done?
As I mentioned earlier, you should check out the CGI.pm documentation (http://users.easystreet.com/ovid/cgi_course/appendices/appendix3.html#creating%20a%20file%20upload%20field). 'cgi-lib.pl' has been deprecated for years. The following snippet should give you a start. If you are on a Windows system, you'll also want to see 'perldoc -f binmore' to avoid having Windows "helpfully" change your line endings for you. CGI.pm, on the other hand, is still being actively maintained and it's standard with Perl, so you should already have it on your system. use CGI qw(:standard); my $fh = param('upfile'); open OUTFILE, "> $somefile" or die "Can't open ($somefile) for writing: $!"; while ($bytesread=read($filename,$buffer,1024)) { print OUTFILE $buffer; } close OUTFILE; Cheers, Ovid ===== "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ovid/cgi_course/ Silence Is Evil: http://users.easystreet.com/ovid/philosophy/decency.txt __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]