Go Back   Northcode Support > SWF Studio V3
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 2012-06-23, 09:29 PM   #1
bee1999
Registered User
 
Join Date: Jan 2003
Posts: 5
http upload progress issue

i use command this

PHP Code:
ssCore[_alias].host({host:hosts});
ssCore[_alias].method({method'POST'});
ssCore[_alias].port({port:"80"});
ssCore[_alias].resource({resource:resource});
ssCore[_alias].protocol({protocol:"HTTP"});
ssCore[_alias].request({dataresource});
ssCore[_alias].inputFile({name:"file"path:filepaths});
ssCore[_alias].setOption({option"connectTimeout"value6000000});
ssCore[_alias].setOption({option"sendTimeout"value3000000});
ssCore[_alias].setOption({option"receiveTimeout"value3000000});
ssCore[_alias].start({});
ssCore[_alias].headers({headers"Content-Type: application/x-www-form-urlencoded\r"});
ssCore[_alias].read({},{callback:uploadComplete});
ssCore[_alias].setNotify({event:"onProgress"}, {callback:uploadProgress});

function 
uploadProgress(ret_objcb_objerr_obj)
{
    if(
ret_obj.success){
    
ssDebug.trace("total bytes transferred: " ret_obj.result);
     }

can uploaded files ok , but ssDebug.trace not out put trace please help me
bee1999 is offline   Reply With Quote
Old 2012-06-25, 11:05 PM   #2
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 11,873
You have to call setNotify BEFORE you call HTTP.read so the notification handler is set up before you start sending bytes. HTTP.read only checks the notification flag when it starts.

NOTE: ssCore is a dynamic object, messing with it like "ssCore[_alias]" is generally not a good idea. It might work, it might have wildly unpredictable results.
northcode is offline   Reply With Quote
Old 2012-07-02, 11:40 PM   #3
bee1999
Registered User
 
Join Date: Jan 2003
Posts: 5
Smile

change code to

PHP Code:

ssCore
[_alias].host({host:hosts}); 
ssCore[_alias].method({method'POST'}); 
ssCore[_alias].port({port:"80"}); 
ssCore[_alias].resource({resource:resource}); 
ssCore[_alias].protocol({protocol:"HTTP"}); 
ssCore[_alias].request({dataresource}); 
ssCore[_alias].inputFile({name:"file"path:filepaths}); 
ssCore[_alias].setOption({option"connectTimeout"value6000000}); 
ssCore[_alias].setOption({option"sendTimeout"value3000000}); 
ssCore[_alias].setOption({option"receiveTimeout"value3000000}); 
ssCore[_alias].start({}); 
ssCore[_alias].headers({headers"Content-Type: application/x-www-form-urlencoded\r"}); 
ssCore[_alias].setNotify({event:"onProgress"}, {callback:uploadProgress}); 
ssCore[_alias].read({},{callback:uploadComplete}); 

function 
uploadProgress(ret_objcb_objerr_obj

    if(
ret_obj.success){ 
    
ssDebug.trace("total bytes transferred: " ret_obj.result); 
     } 

upload file complete , but out put return "total bytes transferred: 425" 2 times (files size upload = 16 MB ) can you show example AS command counter number of bytes transferred ? thank
bee1999 is offline   Reply With Quote
Old 2012-07-25, 12:12 AM   #4
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 11,873
It looks like the bytes transferred is not reporting the bytes in the request buffer, just the form data OR the data that is returned as a result of the POST request.
northcode is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes