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 199943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:04:04+00:00 2026-05-11T17:04:04+00:00

I have a sketch pad made in Flash AS3 like this one here: http://henryjones.us/articles/using-the-as3-jpeg-encoder

  • 0

I have a sketch pad made in Flash AS3 like this one here: http://henryjones.us/articles/using-the-as3-jpeg-encoder

I want to send the jpg to the server and some data from a html form field with php. Is there a way to force the Flash movie to deliver the image file when one presses the submit button?

  • 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-11T17:04:04+00:00Added an answer on May 11, 2026 at 5:04 pm

    it’s a little tricky: You can do it one of two ways:

    Arthem posted this in another thread:

    This was of great help to me:
    http://www.quietless.com/kitchen/upload-bitmapdata-snapshot-to-server-in-as3/

    You need to modify the
    URLRequestWrapper to insert field
    names and file names where needed.
    Here’s what I’ve done:

    bytes = ‘Content-Disposition:
    form-data; name=”‘ + $fieldName + ‘”;
    filename=”‘;

    It does the most formatting of headers
    so the server could understand it as a
    file upload.

    By the way, if you have a BitmapData
    you might need to encode it to JPEG or
    PNG first.

    And I usually use this solution:

    I haven’t used the imageshack API, but you may want to try using adobe’s JPGEncoder class – here’s a quick example that passes a username and the JPG’s byte array, it’s really quite simple.

    private function savePicToServer(bmpData:BitmapData):void
    {
        var jpgEncoder:JPGEncoder = new JPGEncoder(85);
        var jpgStream:ByteArray = jpgEncoder.encode(bmpData);
    
        var loader:URLLoader = new URLLoader();
            configureListeners(loader);
    
        var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
        var request:URLRequest = new URLRequest(ModelLocator.BASE_URL + ModelLocator.UPLOAD_URL + "?user=" + ModelLocator.getInstance().username);
        request.requestHeaders.push(header);
        request.method = URLRequestMethod.POST;
        request.data = jpgStream;
        loader.load(request);
    }
    

    Note that the variables are passed as part of the query string. You can’t use URLVariables, as several people have suggested, as the URLVariables would be stored in the request’s data property, which we are already using to pass the byteArray.

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

Sidebar

Related Questions

I have an XDocument like this one set as a DataContext of my Window
Here's the sketch: http://jsfiddle.net/jondum/efVjj/20/ The goal is to have each of those divs on
I have a little sketch program that I've managed to throw together using Quartz2D,
I still have a question about Enumerations. Here's a quick sketch of the situation.
I need this filled-circle character for my sketch of the UI. I have not
I currently have a flash (AS3) project which consists of a sketchpad onto which
I have Silverlight Sketch project, and I`m using muliticolumn listview to simulate datagrid. <Style
Hey, I have a big problem with my container-sketch. How can I realize this
I am having a hard time thinking this one through Let's say you have
Please see this UI sketch image, I have this div in sidebar (black box)

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.