Download and upload file without storing to PC
Hi,
I have to Upload and download image to server
////////////////////////////For UPLOADING
file//////////////////////////////////////////////////////////////////////////////////////////////////////
CString sFName;
CDC ScreenDC;
ScreenDC.Attach(::GetDC(NULL));
CBitmap Capture;
CSize Dimensions(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics
(SM_CYSCREEN));
Capture.CreateCompatibleBitmap(&ScreenDC, Dimensions.cx,
Dimensions.cy);
CDC MemDC;
MemDC.CreateCompatibleDC(&ScreenDC);
CBitmap *OldBitmap = MemDC.SelectObject(&Capture);
MemDC.BitBlt(0, 0, Dimensions.cx, Dimensions.cy, &ScreenDC, 0, 0,
SRCCOPY);
CImage m2;
m2.Attach(Capture);
//m2.Save(fd.GetPathName());
m2.Save(_T("Image1.jpg"),Gdiplus::ImageFormatJPEG);//ImageFormatJPEG
m2.Detach();
MemDC.SelectObject(Capture);
Capture.Detach();
Is it possible to to MemDC to byte so that its directly uploaded to
server without storage in disk
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DOWNLOAD IMAGE
pFile=pSession.OpenURL
(strQuery);//,NULL,INTERNET_FLAG_DONT_CACHE,NULL,NULL);
if (pFile)
{
BOOL bSuccess = false;
CFile *localFile=new CFile(L"c:\\mk.jpg", CFile::modeCreate|
CFile::modeWrite|CFile::typeBinary );
int numBytes;
char httpBuff[10000];
try
{
while (numBytes = pFile->Read(httpBuff, 10000))
{
localFile->Write(httpBuff, numBytes);
}
}
I am able to download file but file is jpeg image so in oder to show
image to any control .I had to store it in disk.
Can u sugesst me any method by which i can show byte data to image in
any picture control
...//////////////////////////////////////////////
Thanks