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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you use TNMHTTP?

Status
Not open for further replies.

bailsoft

Technical User
Mar 28, 2000
14
GB
Hi,
I've tried:

NMHTTP1->ReportLevel = Status_Basic;
NMHTTP1->InputFileMode = true;
NMHTTP1->Body = "D:\\DOWNLOADS\\example.jpg";
NMHTTP1->Get("
to download a JPEG file (BTW in case you haven't guessed the example URL is not real). The file I was trying to download was 7k in size, I can only receive the last 3k or so.
Here's my question: Why?

Please help - it's driving me mad!
 
Okay, I've work it out myself. For the benefit of others, here is the core code required to download a file using TNMHTTP:

int fhandle;

NMHTTP1->ReportLevel = Status_Basic;
NMHTTP1->InputFileMode = false;
NMHTTP1->Get(" fhandle = _rtl_creat("C:\\DOWNLOADS\\bigsateuj.jpg", 0);
lseek(fhandle, 0, SEEK_SET);
_rtl_write(fhandle, NMHTTP1->Body.c_str(), NMHTTP1->BytesTotal);
_rtl_close(fhandle);

Best wishes,
Bailsoft
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top