Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1838320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:27:45+00:00 2026-05-17T06:27:45+00:00

I am trying to save some images from Flash to Php by sending a

  • 0

I am trying to save some images from Flash to Php by sending a jpgstream, capturing it in php and pushing it to a file. Not sure what I am doing wrong here.

I am putting all the images I need into an array like so: (history is just where I am keeping all the image data)

for each($value in history)
            {

                var jpgSource:BitmapData = new BitmapData ($value.sourceImg.width, $value.sourceImg.height);
                jpgSource.draw($value.sourceImg);
                var encoder:JPEGEncoder = new JPEGEncoder(100);
                var jpgStream:ByteArray =  encoder.encode(jpgSource);
                var imgDetailArr:Array = new Array(jpgStream, $value.name);
                imgArr.push(imgDetailArr);



            }

And then i send that to PHP using a remote object and amfphp:

rmObj.saveUserImages( imgArr);

On the php side I am doing this:

function saveUserImages( $imgArr)
    {
        foreach($imgArr as $value)
        {


            ob_start();
            /* output image as JPEG */
            $image = imagecreatefromjpeg($value[0]);     
            header('Content-type: image/jpeg');
            imagejpeg( $image );
            /* save output as file */
            ob_flush();
            file_put_contents( "images", ob_get_contents() );


        }
    }

But this doesn’t seem to do the trick. I have been going through a bunch of different tutes and code snippets, so maybe I just ogt something confused along the way. I have done this before though and don’t remember it being this difficult.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:27:45+00:00Added an answer on May 17, 2026 at 6:27 am

    You may be better off calling JS from Flash and pass a path to the file via AJAX. Then, use PHP to upload the files directly. PHP has support for file uploads from a hard drive.

    Edit:

    On second thought, try switching ob_flush with the line after it. It looks like you are deleting your temporary data before saving it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to save some layouts from DevExpress Grid Controls so that users can
I'm trying to save some lookup table data out to a YAML file so
I'm trying to save some data to A file in android, I'm using herefor
I'm trying to make a Windows Phone 7 app that will save some images
I'm trying to save some data to core data from a different view and
I'm trying to flatten some images I get from a server down to 40
I'm trying to capture some images from an old database. When writing scrapers, I
I am trying to read a .raw file to find some corrupted images. I
I'm trying to save some data into an array but unfortunately all the data
I'm trying to save some UserControl-Infos into a List like this: List<UserControlDetails> myList; public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.