Highlighted

File.upload() ok on Android... IOError on iOS

Explorer ,
Apr 04, 2014

Copy link to clipboard

Copied

Hi everyone, i got a file upload (PNG from bytaArray) to server working on android, but giving me ioError on iOS...

Anyone knows what can be wrong in this, or what can i check on iOS ?

var ba:ByteArray = PNGEncoder.encode(bitmapData);

var file:File = File.documentsDirectory.resolvePath("test1.png");

var fileStream:FileStream = new FileStream();

fileStream.open(file, FileMode.WRITE);

fileStream.writeBytes(ba);

fileStream.close();

var urlRequest:URLRequest = new URLRequest("http://www.myserver.com/uploadPhoto.php");

urlRequest.method = URLRequestMethod.POST;

file.addEventListener(Event.COMPLETE,onImageSent);

file.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

file.upload(urlRequest);

TOPICS
Development

Views

161

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

File.upload() ok on Android... IOError on iOS

Explorer ,
Apr 04, 2014

Copy link to clipboard

Copied

Hi everyone, i got a file upload (PNG from bytaArray) to server working on android, but giving me ioError on iOS...

Anyone knows what can be wrong in this, or what can i check on iOS ?

var ba:ByteArray = PNGEncoder.encode(bitmapData);

var file:File = File.documentsDirectory.resolvePath("test1.png");

var fileStream:FileStream = new FileStream();

fileStream.open(file, FileMode.WRITE);

fileStream.writeBytes(ba);

fileStream.close();

var urlRequest:URLRequest = new URLRequest("http://www.myserver.com/uploadPhoto.php");

urlRequest.method = URLRequestMethod.POST;

file.addEventListener(Event.COMPLETE,onImageSent);

file.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

file.upload(urlRequest);

TOPICS
Development

Views

162

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 04, 2014 0

Have something to add?

Join the conversation