Php :: Send More Than One 'stream' Of Jpeg ByteArray Data In A Single URLRequest And Output 2 Images?

Jan 25, 2011

I have an AS3 swf which users can upload jpg images to my EC2 instances which sit behind and Elastic Load Balancer. The jpg images are converted into bytearray data and sent using URLLoader.load(URLRequest)I make 2 calls when uploading, one to upload a large version, then another to upload a thumbnail version. A PHP script to which the bytearray data is uploaded converts this to a file using file_put_contents($destination,$GLOBALS["HTTP_RAW_POST_DATA"])Is it possible to combine these two requests into a single request which contains both the bytearray data for the large and thumbnail images and 'split' the HTTP_RAW_POST_DATA to create 2 files at the server. This would be better than uploading the bytearray for the large version then using something like ImageMagick to resize the resulting image into a thumbnail which I realise is another option.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Sending ByteArray As Part Of URLRequest Data?

Dec 14, 2009

I am facing some issues sending byteArray as part of my URLRequest data to a cfm page.I need to send an collection of objects as part of byteArray.But when i try doing so,i get illegalArgumentException.I am doing it this way

var obj:Object=new Object();
obj.name='Mike';
obj.age='26';
var byteA:ByteArray=new ByteArray();

[Code].....

Secondly when i tried sending xml obj as part of ByteArray,It worked fine ,but i get unwanted characters appended at the start and end of the xml.

View 0 Replies

Php :: Use HTTPService Rather Than URLRequest To Send Data. Content Type Is Messing With The Data?

Jul 28, 2011

I need to send a byte array of data (its an image source) along with a bunch of other vars to a service.If I send the byte array using something like the following

var request:URLRequest = new URLRequest ( 'http://www.mydomain.com/upload.php' );
var loader: URLLoader = new URLLoader();
request.contentType = 'application/octet-stream';

[code].....

View 1 Replies

ActionScript 3.0 :: Send Both Bytearray And Form Data?

May 11, 2010

I'm currently working on a small project. The user is supposed to draw/do a puzzle within flash, and also fill out a form with his details and comments.

When clicking the send-button, the image should be sent along with the form as an email.

I already know how to send the image as an email via php, and I know how to send a form as an email via php, BUT - I can't seem to do it together.

I've googled a bit and I found out that I cannot pass both the bytearray (from the image) and the form-data as URLVariables at the same time.

One way I got it to work is by passing the values from the form-data as a part of the URLRequest (and then use $_GET in the .php-file), but this has limitations as it can only pass 100 characters. As the user should be able to comment on his work, using GET with its limitations isn't an option.

View 2 Replies

ActionScript 2.0 :: URLRequest - Send The Xml Data To PHP / PERL Script (server)

Dec 13, 2006

I have XML object formed and data ready to write to the server by means of server-side script. The code used on the server-side script is testing code available from the ActionScript 3.0 cookbook examples (by Joey Lott). It basically takes the XML object, parses it and writes some of the text node values into a textfile. What i want to achieve send the xml data from AS3.0 to PHP/PERL script, parse these data, write some variables from the xml object into a textfile on the server.

[Code]...

View 1 Replies

Php :: Flex - Send A FLV Format Data In ByteArray Using URLloader To A Script?

Dec 15, 2010

Im creating flash game that have the functionality to capture/record its gameplay that can be viewed later by the user, like a replay.

As for now Im already able to record the game and write it into a flv format in a ByteArray variable.

What Im working right now is how to send that ByteArray(the video file) to a php script and save it to a web server.

I've run into the URLLoader in flash where it can send the data and php will receive it thru the POST method. Unfortunately, the ByteArray containing the flv data must be first correclty encoded for php to read it. I figured this out from the example in the net where it does the same thing only that it is only sending a JPEG ByteArray instead of a FLV format using the JPEGENCODER.

Is there any existing class like the JpegEncoder for FLV format or any Video formats? Or any work around like creating the encoder my self?

here is my current code to send the ByteArray

//send byteArray to a php script
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;

[Code]....

View 1 Replies

ActionScript 2.0 :: Stream Images (single Jpg) From Webcams Into A Swf?

Nov 5, 2009

I am trying to stream images (single jpg) from webcams into a swf. I know little about actionscript, and what I have so far is from what I have found in other posts around the web. My first attempt worked, but caused a bad white flash between the image being refreshed. So from others I have learned that this will happen unless I use two movie containers and buffer in between them? Here is the code I have, and it does not work.

[Code]...

I don't get any compiler errors. I think this is as2, but I am not sure

View 0 Replies

Flex :: Uploading Bytearray Via URLRequest?

Sep 4, 2011

I'm trying to upload a bytearray, but am struggling to make the content-type go as image/png (it always goes as application/octet-stream no matter what I do.).I've checked the request with Charles Proxy, and can confirm that it indeed always goes as application/octet-stream.My code is:

protected function onObjectLoaded(event:Event):void
{
var byteArray:ByteArray = new ByteArray();
var fileName:String = fileReference.name;
var uploadPath:String = serviceURL;

[code]....

how to change this, so the bytearray itself gets passed in as image/png instead of octet-stream This image is being upload from the client side, and being passed as a FileReference, which I then invoke load(), and then get it's "data" attribute, which is where the bytearray is.

View 1 Replies

Data Integration :: Php Data Correct On HTML Output But Output To Flash Is Incorrect?

Jun 22, 2006

var nextY = 0;
var nextY2 = 18;
for (var count = 0; count < result_lv.typeCount; count++)
{

[code]....

The type count is correct but the information for the project is wrong.

View 1 Replies

ActionScript 2.0 :: API Output To JPEG Using PHP And GD?

Aug 31, 2004

i got the source from Jerry Jasuta to build a Drawing API, everything works perfectly it draws and saves the images into jpg. I have a little problem, how do i make it load images to the same file, I want to be able to load pictures and draw on them then save them into jpg.Actionscripting in the frame,

drawing=false;
data='';
createEmptyMovieClip('_keyListener',1);
Key.addListener(_keyListener);
_keyListener.onKeyDown=function(){

[code]...

View 2 Replies

Convert Flash Output To A JPEG?

Oct 21, 2009

I want to allow a user to create a comic page layout in Flash which would allow them to upload JPEGs into the comic page layout then the Flash interface would allow them to move them around and add speach bubbles.
 
I would then like these to be uploaded to my web server and the whole thing converted to a JPEG. What would be involved to achieve this?

View 2 Replies

Flash :: URLRequest Event.COMPLETE Loop - Trace Commands Output

May 18, 2011

How can I reorganise the code below so the trace commands output i for each element in the photourls array and not just the last element? In a 6 element array, the trace(i); line outputs 5,5,5,5,5,5 rather than 0,1,2,3,4,5.

[Code]...

View 2 Replies

ActionScript 3.0 :: Stop URLRequest Stream?

Feb 12, 2009

In the following code, I call a separate swf file that uses xml to load in a series of images and automatically rotates them.If, in the Main movie, it goes to a new scene that doesn't hold this swf but before all the images are loaded, it continues to load all of them in the background.So, I tried to get it to close the loader when it goes to the new scene.But it isn't working. It's still streaming and loading the images in the background.

ActionScript Code:
var imageRequest:URLRequest = new URLRequest("imageRotator_01.swf");
var imageLoader:Loader = new Loader();

[code].....

View 0 Replies

Send A ByteArray To FMS?

Sep 23, 2011

Who knows how to send a ByteArray to FMS?

View 1 Replies

Flex :: Url - Send Array In URLRequest?

Jun 24, 2011

In efforts to allow users to save their progress in my application, I've decided to allow them to save. In order to do this, I'd like to create an array with all the necessary information, and send that information to a coldfusion (.cfm) file and process the information from that page. Is it possible to send an array instead of a bunch of url variables? It is possible (and quite probable) that users would exceed the query string length of most browsers.

View 1 Replies

Actionscript 3 :: Send Multiple Addresses To URLRequest?

May 17, 2011

I'm using the weather.com XML service to retrieve forecast data. I created an instance of UrlLoader and passed the entire HTTP address including credentials, location and other parameters to it. This works very well in tandem with the XML(urlLoader.data) functionality in that I get the result for the specified location ID. I then use E4X to trace just the nodes needed.

The tricky part is that I have to do this for 19 additional cities. I've done the initial work in the Main class, Main function, private function onXmlLoaded. I tried creating a new public function getCityName making the new URLRequest, tracing XML and adding values to my components. However, when I attempt this, I receive

Error 5006: An ActionScript file cannot have more than one externally visible definition.

How can I easily setup the URLRequest to request data for all 20 cities, and parse the results thereafter? Do I pass an array of location IDs to URLRequest, because that's the only part of the HTTP request that's different. Do I create separate ActionScript files with their own class and functions for each of the 20 queries?[code]...

View 2 Replies

Flash - Send Custom Headers With URLRequest?

Jun 1, 2011

I want to add Authorization header to my requests.I added the following line in crossdomain.xml of the server:

<allow-http-request-headers-from domain="*" headers="Authorization"/>

And still, the header is not sent (checked with Wireshark).

EDIT:the code of the urlRequest:

var request:URLRequest = new URLRequest();
request.method = URLRequestMethod.POST;
request.url = this.uploadURL;
request.data = post;

[code]....

View 2 Replies

C# :: .NET Zlib Stream Compatible With ByteArray.uncompress?

Oct 9, 2009

I can't seem to get a stream that Flex 3 want's to decompress.

I've tried:

System.IO.Compression.GZipStream
System.IO.Compression.DeflateStream
ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream
zlib.ZOutputStream

None of these seem to make ByteArray.uncompress happy, i.e. I get

Error #2058: There was an error decompressing the data.

Also the whole Deflate vs zlib has me going around in circles. It seems that according to the wikipedia article, zlib is an implementation of DEFLATE. But according to Actionscript they are two different things?

Microsoft also seems to indicate the Gzip at least uses the Deflate algorithm, as in their docs they refer that GZipOutputStream uses the same compression algorithm as DeflateStream. So I'm assuming that it's just a header difference, which would indicate that's "no good" as far as 'ByteArray.uncompress' as the "DEFLATE" algorithm is only supported in AIR applications.

Sample "server" code, using SharpZipLib in this case (not working):

public virtual bool ProcessRequest(string path, HttpListenerContext context)
{
var buffer = File.ReadAllBytes(path);
// Specifying to strip header/footer from data as that seems to be what the

[code]....

View 2 Replies

Flash :: Get A Bytearray From File Stream In Adobe AIR?

May 27, 2010

I read limited (small - 15 - 500 mb files). I need to be able to put all file bytes into one single bytearray. So I have a function:

[Bindable]
public var ba:ByteArray = new ByteArray;
//.... code ....//

[Code]....

But it does not work=( - gives me Error: Error #2030: End of file was encountered.

How to get a full bytearray from stream to use it as normal bytearray?

View 1 Replies

ActionScript 3.0 :: Create / Send Dynamic Variables With URLRequest?

May 9, 2009

I'm trying to send variables to a payment gateway (dibs) and need to post variables to the likes of[code]...

In creating a dynamic variable I'm doing this, which works. But it's not posting the values to the php-page. (The "normal" variables are being posted just fine, so the error isn't there) [code]...

View 1 Replies

ActionScript 3.0 :: Play MP3 Sound From Buffer (ByteArray / Stream)?

Oct 25, 2009

I have a buffer with MP3 data (If I would save this buffer and call it buffer.mp3 it would play, but in this situation I should not save it to file system). I have to play it, but I can not, what shall I do? I tried the next code to play that buffrer(ByteArrayStream) (I get MP3 data from server the method of getting data works fine (tested on text int's etc) I call the returned ByteArray readResponse because I have some seading method and It is it's response).

[Code]....

View 5 Replies

As3 :: Javascript - Flex - Send A Jpg Image As ByteArray

Jan 10, 2010

How to send a jpg image as ByteArray from as3 to javescript? And how to convert ByteArray to image in javascript?

View 3 Replies

ActionScript 2.0 :: Create Flash App Where A Single Jpeg (person Headshot) Is Loaded Into The Masked Movieclip?

Jan 31, 2007

I'm trying to create flash app where a single jpeg (person headshot) is loaded into the masked movieclip (same size as passport photo) (using loadMovie), then user can edit the image (drag inside mask, zoom, rotate) and then after pressing a button the app duplicates the EDITED image 4 times - to make sort of headshot sheet.

While I know how to load movie, drag single clip or scale it, I have no idea how to duplicate the movieclip once is edited, to make identical copies of it (scaled, rotated...)If I use duplicateMovieClip it won't work since it won't duplicate the loaded image.

View 3 Replies

Flash :: URLRequest - Send A Delete Method From Player (Flex)

Jan 14, 2010

Need to find a way to send a delete method from Flash Player (Flex). Currently it's not done by default (except for from AIR), but I am sure someone has augmented the URLRequestHeader to get it to work properly. I've tried this, it isn't working:

[Code]...

View 2 Replies

ActionScript 3.0 :: Send A Bytearray Object To A Javascript Function?

Aug 11, 2009

I need to be able to send a bytearray object to a javascript function or a java method, but I was wondering if I could do it using XMLHTTPRequest.

import asfiles.encoding.JPEGEncoder;import flash.display.Bitmap;import flash.display.BitmapData;import flash.external.[code]...

So I have a video that plays stream from a webcam,I will click a button and take a picture. I encode that picture using JPEGEncoder then I store it in a ByteArray.How do I send that data over to either a javascript function or a java class?I don't want to use the navigateToURL (URLRequest) method because that will redirect my page.Is there a way to send the data to a function while still staying on the same page?For example, make a asynchronous call to a javascript function or java method?

View 1 Replies

Php :: Send An Actionscript ByteArray As A POST Variable (within Facebook)

Dec 18, 2010

I would like to use Flash to send a ByteArray (of a PNG image) to a php file, in a facebook application. Is there a way to do this by sending the ByteArray as just one POST variable instead of as the entirety of the POST data?

There was a nearly identical question here: How can I send a ByteArray (from Flash) and some form data to php? but the problem is different; instead of smuggling other variables in other parts of the request, the image itself has to be sent as just a variable because Facebook commandeers the post data and puts in its own junk.

If not, can I send the image in some form other than a byteArray?

View 2 Replies

ActionScript 3.0 :: Send ByteArray To Flash Without Using Php_amf Extension

Oct 3, 2010

I'm working on a Flash tool that needs to send some data in the form of a flash.utils.ByteArray instance to PHP (amfphp service class) and get that data back from the amfphp service as flash.utils.ByteArray instance. Now I can do all of these with the php_amf extension enabled on the local WAMP server. And the tool works fine. But how can I achieve this without the php_amf extension? I'm deploying on a shared hosting server and I don't have access to the php.ini and also the dl() function of PHP is disabled for security reason. With the extension disabled, I can send the ByteArray instance to PHP and save the data to DB. But the problem arises when I try to retrieve the data from DB, create a ByteArray instance (amfphp helper class) with the data and send back to Flash. I'm guessing here that proper AMF message is not being constructed because of the absence of the php_amf extension.

View 1 Replies

ActionScript 3.0 :: Send Email With Attachment (swf Printscreen->JPEG) Capability?

Jan 4, 2010

only those who actually got real code to show please Im looking for help on how to create send-email with attachment using AS3.

Furthermore the attachment should be printscreen of the flash movie converted into JPEG (preferrably with no need to upload the file to server - can this be done on the fly?), and the JPEG then should be included as attachment in the email.

[Code]...

View 7 Replies

ActionScript 3.0 :: Getting Audio Stream Meta Data From An Akamai FMS Stream

Jul 21, 2009

I am having trouble getting audio stream meta data from an Akamai FMS stream. Everything is undefined and I'm not sure why. I am hoping maybe someone will notice something that I am overlooking. The stream is connecting and playing without a problem I just can't seem to figure out why all the meta data is undefined.

[Code]...

View 6 Replies

ActionScript 3.0 :: Stream Audio Source From Output?

May 27, 2010

I'm writing an application with AS3 and Flex 4 for Adobe Air 2.0RC and I seem to have run into an interesting predicament.

I am aware of the microphone class and the method to capture recording from them to a byte-array, I am wondering, however, if there is a way to capture another source of audio, say, from an output on an external sound card.

Is anyone aware of an AS3 method of capturing sound from an output?

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved