[urgent] Flex fileRef.download problems.


hi all,

 

i having trouble figuring out here.

i sending images coldfusion, , using cfzip create zip of images download.

i using fileref.download download zip user's computer in actionscript.

the problem flex let user download zip before finished compiling.

so if there 68 images in zip on webserver, depending on how fast select save location 42...or 29....etc.

 

i tried putting download function in return handler coldfusion remote object, fileref.download must executed mouse-click security reasons.

here click handler "download images" button.

here code below:

 

public function clickhandler1(event:event):void
            {               
                h = 0;
                randomfilenum = math.round(math.random()*(99999-11111))+11111;
               
                var t:int;
                (t = 0; t < hiresimagecollection.length; t++)
            {
               
                image1 = hiresimagecollection[h];
               
               
                imgstylenumber = stylenumbercollection[h]+ "_" + colorcollection[h] + poricollection[h] ;
                cfcquer4.getcartimages(image1,imgstylenumber,randomfilenum);
               
                h = h + 1;
            }
                            
                 downloadurl.url = "http://costmesa-svr-17/hib/imagestemp/downloadedimages" + randomfilenum + ".zip" + "?" + math.random();

                 fileref.download(downloadurl, 'downloadedimages' + randomfilenum + '.zip');

            }

 

 

thank needed help.

 

jk

my server-side knowledge limited, have looked flex's asynctoken? also article has info @ it:

an asynctoken primer

 

it seems using async may more ideal, say, have timer execute your  fileref.download() few seconds later.  again, weak on side of field.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???