How to use IRequest::BinaryRead function
Hi!
I've developed ISAPI script for uploading the file via HTTP (from browser)
on VC++. Under the ISAPI I can upload big size file (100 MB and more) but
in case I'm tring to use my ActiveX component for ASP (developed on VC++
too) I can't do it correctly. I did not found where is the trouble. Can I
ask you to help me?
Regards,
Eugene Labunsky.
This is some peace of code.
VARIANT tmp_bin_variant;
m_piRequest->get_TotalBytes (&ip);
VARIANT ttt;
ttt.vt = VT_BYREF|VT_I4;
ttt.plVal = &ip;
m_piRequest->BinaryRead(&ttt, &tmp_bin_variant);
HANDLE save_all_bin;
DWORD result_saved_bytes;
// Try to save the bin part of the posted data
DWORD it;
save_all_bin =
CreateFile("c:"\temp"\full_ver2.dat",GENERIC_WRITE ,0,NULL,CREATE_ALWAYS,0,NU
LL);
if (save_all_bin != INVALID_HANDLE_VALUE)
{
// in case big file it does not works correctly !!! Why?...
if (!WriteFile (save_all_bin,tmp_bin_variant.byref,
ip,&result_saved_bytes,NULL))
{
// error
}
if (save_all_bin != NULL)
CloseHandle(save_all_bin);
}
|