0

I want store images from a flex application in a mysql database i a blob field, but it's taking me a lot of troubles.

I guess need to send from httpservice to php script the image, but... the flex httpservice send parameters by $_REQUEST and php needs $_FILES to split the data and the mimetype.

There is a way to use the $_REQUEST variable as $_FILES? or a way to split the image data since flex before send it?

alex
  • 323
  • 1
  • 2
  • 16
  • 1
    why would you ever trust the mime-type included in $_FILES? That's the mime type provided by the **CLIENT**. Take the data in $_REQUEST, and run it through fileinfo to see what the mime type REALLY is. never trust the client to not lie to you. – Marc B Oct 30 '14 at 20:55
  • Tanks Marc B I will do it that way, but now, how can I send my imagen by the flex's httpservice? – alex Oct 31 '14 at 00:08
  • You could base64-encode images and send them through `$_REQUEST` to your PHP-script. And on the receiving side you could do something like in my script: https://github.com/afarber/ios-newbie/blob/master/MyGameCenter/gc-upload.php – Alexander Farber Oct 31 '14 at 09:14

1 Answers1

0

You can achieve this using the upload() method from the flash.net.FileReference class

Here is a post on adobe that addresses this exact problem: http://www.adobe.com/cfusion/google/communityengine/index.cfm?postId=5241&productId=2