Jump to content

fetchRemote Help !


Tremidinha

Recommended Posts

Hi I have a problem with the function fetchRemote. I hope you can help me.

Server Side:

function startImageDownload( playerToReceive ) 
    fetchRemote ( "www.exemple.com/exemple.png", myCallback, "", false, playerToReceive ) 
end 
addCommandHandler("down",startImageDownload) 
  
function myCallback( responseData, errno, playerToReceive ) 
    if errno == 0 then 
        triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) 
    end 
end 
  

Client Side:

addEvent( "onClientGotImage", true ) 
addEventHandler( "onClientGotImage", resourceRoot, 
    function( pixels ) 
        local file = fileCreate( pixels..".png" ) 
        if ( file ) then 
            outputChatBox("Test") 
            fileWrite( file, pixels );  
            fileClose( file ); 
        end 
    end 
) 
  

I think the code is right but there appears no error and the file is not created, someone could help me or explain to me why this happens?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...