uploading files

They have: 32 posts

Joined: Jan 2001

I'm making a script for uploading text files via http to my webserver.
this is a part of the script

$filename = param('file');
$dir = "/www/dir";
$info_outfile = "text.txt";
(open INFO,">$dir/$info_outfile");
while ($bytes = read($filename,$data,1024)) {
$length_info += $bytes;
print INFO $data;
}
close(INFO);
chmod 0777, "$info_upload_dir/$info_outfile";

the problem is that the script upload(or make) a 0 byte file
please help me!!! I dont understand whats happening Sad
thanx!

Adolfo

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Did you make the form on the client side the right enctype?

They have: 32 posts

Joined: Jan 2001

yes I did

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.