# Question on image uploading

**URL:** <https://forum.kirupa.com/t/question-on-image-uploading/289354>\
**Category:** flash\
**Created:** [May 29, 2009, 9:07am UTC](https://forum.kirupa.com/t/question-on-image-uploading/289354 "2009-05-29T09:07:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cRoss05](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@cRoss05](https://forum.kirupa.com/u/cRoss05)\
**Post date:** [May 29, 2009, 9:07am UTC](https://forum.kirupa.com/t/question-on-image-uploading/289354/1 "2009-05-29T09:07:25Z")

</div>

Why is it image is not uploading when im running on swf version, but image uploading works when im running the exe version of the flash project?

And how can i add a progress bar to check if the image is uploading or not? Oh yeah, im new at actionscript so please go easy on me.

anyway here’s the code.

```auto
import com.adobe.images.JPGEncoder;

var jpgSource:BitmapData = new BitmapData (container_mc.width, container_mc.height);
jpgSource.draw(container_mc);

var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);

Save.addEventListener(MouseEvent.CLICK, save);
function save ($event:MouseEvent) {
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest("jpg_encoder_download.php?name=sketch.jpg");
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;
navigateToURL(jpgURLRequest, "_blank");
}

// listen to button
image_button.addEventListener (MouseEvent.MOUSE_DOWN, load_image);

// load image
function load_image(event:Event):void
{
    var imageLoader:Loader = new Loader;
    imageLoader.load (new URLRequest(image_string.text));
    imageLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);
}

// load image
function imageLoaded(event:Event):void
{
    image_mc.addChild(event.target.content);
}

```

And how can i say to image\_mc to load the jpeg at the center of image\_mc’s axis. So that when i flip the image, the image will flip vertically at the center?

Do i make sense? sorry for my bad english \>.\<

Thanks a lot.
