×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

write into a file using iis server

write into a file using iis server

write into a file using iis server

(OP)
Hi

I begin in perl and i wrote i little programm to upload a file and I want to wrote this file in in a new file but the file stay empty.


this is my code

use CGI;

my $q=new CGI();

print $q->header();
print $q->start_html("UPLOAD FILE");
print $q->start_form();
print $q->filefield('upload_file','starting value',50,80);
print $q->submit();
print $q->end_form();


if ($q->param('upload_file'))
{
    my $fh=$q->upload('upload_file');
    
        open (OUTFILE,">>allo.txt");
    my $bytesread="";
    my $buffer = "";
        while ($bytesread=read($fh,$buffer,1024))
    {    
        print OUTFILE $buffer;
        }
    close(OUTFILE);

}
print $q->end_html();

RE: write into a file using iis server

Make sure the form enctype is "multipart/form-data" for a form that is uploading a file.

Like this I think..

CODE

print $q->start_form( enctype=>"multipart/form-data" );

Jeb

RE: write into a file using iis server

Check the FAQ's here and in the Perl forum, there's some good working examples there too

HTH
--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close