i am trying to write a program for file upload. If the file size is > 64K then it is to be mapped in chunks of 64K and transferred in chunks of 1000 bytes till the whole file is
transferred.
Now the problem is if the file is < 64K it gets uploaded but if it is > 64K then it fails. The first 64K bytes get mapped but after that the MapViewOfFile fails. WHat could be the reason. The function is something like ...
if ((h_file_map = CreateFileMapping(s_curr_file_xfer_data.xfer_file_handle, NULL, PAGE_READONLY, 0, 0,NULL)) == NULL)
{
// ...
}
if ((l_ptr_mapped_view = MapViewOfFile(h_file_map,FILE_MAP_READ,0, l_start_addr,
FILE_VIEW_SZ )) == NULL)
{
//FILE_VIEW_SZ = 64K
"Failure in mapping view for file "
// ...
}
Thanks
transferred.
Now the problem is if the file is < 64K it gets uploaded but if it is > 64K then it fails. The first 64K bytes get mapped but after that the MapViewOfFile fails. WHat could be the reason. The function is something like ...
if ((h_file_map = CreateFileMapping(s_curr_file_xfer_data.xfer_file_handle, NULL, PAGE_READONLY, 0, 0,NULL)) == NULL)
{
// ...
}
if ((l_ptr_mapped_view = MapViewOfFile(h_file_map,FILE_MAP_READ,0, l_start_addr,
FILE_VIEW_SZ )) == NULL)
{
//FILE_VIEW_SZ = 64K
"Failure in mapping view for file "
// ...
}
Thanks