Dear wise-one,
I have been trying to get the upload file feature to work. It is almost working but one problem, it is not transferring the file size. the file is transfer in the right location and file name on the web server but the file size is 0.
another question "binmode" is this to make sure the file is tranferring in binary mode?
here is the code below
----------------------
##--------
# uploadImage()
##--------
sub uploadImage
{
$upfile = lc(join '', split / /,(split/\\/, param("logo")[-1]);
$abs_file_to_create .= "/location_on_the_web_server/";
$abs_file_to_create .= "$upfile";
open(NEW_FILE,">$abs_file_to_create" || die "Can't open $abs_file_to_create for output: $!";
binmode NEW_FILE;
binmode $upfile;
while ($size = read($upload_logo, $data, 8192))
{
print NEW_FILE $data;
}
close NEW_FILE;
}
I would love your advise. thanks Thank you for your knowledge, wisdom and time!
There
I have been trying to get the upload file feature to work. It is almost working but one problem, it is not transferring the file size. the file is transfer in the right location and file name on the web server but the file size is 0.
another question "binmode" is this to make sure the file is tranferring in binary mode?
here is the code below
----------------------
##--------
# uploadImage()
##--------
sub uploadImage
{
$upfile = lc(join '', split / /,(split/\\/, param("logo")[-1]);
$abs_file_to_create .= "/location_on_the_web_server/";
$abs_file_to_create .= "$upfile";
open(NEW_FILE,">$abs_file_to_create" || die "Can't open $abs_file_to_create for output: $!";
binmode NEW_FILE;
binmode $upfile;
while ($size = read($upload_logo, $data, 8192))
{
print NEW_FILE $data;
}
close NEW_FILE;
}
I would love your advise. thanks Thank you for your knowledge, wisdom and time!
There