Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

first line is missing 1

Status
Not open for further replies.

imad77

Instructor
Oct 18, 2008
97
CA
Hi,

I call a script from a Web page, this Perl script is located in Linux server. I experience an issue when I try to upload a file from a Windows station to this server. The file is uploaded well, but the first line is missing. I tried with a lot of files and all of files don't contain the first line.

Can someone help me to fix this issue?

Here is a part of the script:
===============
my $br=0;
my $s=0;
my $buffer=0;

$fpath=$q->param('uploadfile');



open(BWF,">$writefile");

while ($br=read($fpath,$buffer,2096))
{
$s += $br;
binmode BWF;
print BWF $buffer;
}

close(BWF);
 
Hi PinkeyNBrain,

It works fine, I tried this commands:

Thanks a lot.
=========
open(BWF,">$writefile");
binmode BWF;
seek($fpath,0,0);
while ($br=read($fpath,$buffer,2096))
{
$s += $br;
binmode BWF;
print BWF $buffer;
}

close(BWF);
 
You can drop that binmode line thats inside the "while" loop.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top