5 Replies Latest reply on Mar 7, 2013 3:20 PM by kglad

    BitmapExporter - generate PNG with specific filename

    anglim_wp

      Hi All,

       

      I am integrating Mario Klingemann's BitmapExporter into a small project and i have it so that the user can press a button and generate the png. Based on his comments in the code, I think that there may be a download dialog box/option that is supposed to pop up, but cant be sure about this. My problem is that i need some way for the user to get the file back after they generate it to the directory on my server. so far the code generates a uniqueID for each png. I was thinking that If i knew the specific file name that the user generates, then i would have more luck being able to somehow allow them to retrieve the file... Can anyone give me any insight as to what my best options might be?

      The catch is that Mario's code also relies on PHP to generate the PNG, so my head is spinning a bit.

       

      //some of the AS code:

       

      private function onSaved( serviceUrl:String, fileName:String ):Void

                          {

                                    BitmapExporter.dispatchEvent({

                                                                                                           type:             "saved",

                                                                                                           target:           BitmapExporter,

                                                                                                           url:              serviceUrl,

                                                                                                           fileName:                       fileName,

                                                                                                           uniqueID:                       uniqueID,

                                                                                                           sentBytes:                       sentBytes,

                                                                                                           time:                                 totaltimer,

                                                                                                           compressionRatio: sentBytes / (bitmapWidth * bitmapHeight * 4)

                                                                                                           });

                                    reset( true );

                          }

       

      //some of the PHP code which i believe helps generate the random number/unique ID:

       

      case "getImageHandle":

       

                                    $uniqueID = md5( microtime() . rand() );

                                    sendResult( "success=1&uniqueID=$uniqueID" );

                          break;

       

       

      Maybe i should be looking more in a PHP Forum, but I have always gotten my questions answered here, so wanted to try here first. Thank you in advance!

       

      - Pat