Raised This Month: $12 Target: $400
 3% 

[EXTENSION] Web downloader


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
)v(aster
Junior Member
Join Date: Feb 2008
Old 07-13-2008 , 16:38   Re: [EXTENSION] Web downloader
Reply With Quote #17

Hi

Not too sure what i've done wrong. When I use the sample plugin, I cant find a file created. And when I run the following, I see this in the sm log:
L 07/14/2008 - 05:07:59: [m_downloadtest.smx] $$$$

EDIT: Worked it out, need to read the string in the DownloadComplete callback, as it's threadded.

Code:
public DownloadComplete(const sucess, const status, Handle:arg)
{
    PrintToServer("DownloadComplete: %i %i",sucess, status);
    CloseHandle(down);
}
public Progress(const recvSize, const totalSize, Handle:arg)
...
 
public OnPluginStart()
{
    down = CreateDownloader();
 
    SetURL(down,"http://domain/file.php/");
 
    SetCallback(down,DownloadComplete);
    SetProgressCallback(down,Progress);
 
    new String:response[1000];
 
    SetOutputString(down,response,sizeof(response));
 
    Download(down);
 
    LogMessage("$$$$%s", response); 
}

Last edited by )v(aster; 07-14-2008 at 14:36.
)v(aster is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode