{"id":347,"date":"2011-04-08T11:35:50","date_gmt":"2011-04-08T16:35:50","guid":{"rendered":"http:\/\/www.thaylin.com\/blog\/?p=347"},"modified":"2011-04-08T11:40:27","modified_gmt":"2011-04-08T16:40:27","slug":"uploading-multiple-imagesdata-to-server","status":"publish","type":"post","link":"https:\/\/www.thaylin.com\/blog\/2011\/04\/08\/uploading-multiple-imagesdata-to-server\/","title":{"rendered":"Uploading multiple images\/data to server!"},"content":{"rendered":"<p>Oh man what a life saver this was! Super easy to implement and works awesomely so far!<\/p>\n<p><a href=\"http:\/\/blog.inspirit.ru\/?p=139\">Multipart form data in as3 [Class version 1.2]<\/a><\/p>\n<p>Implementing is as easy as this:<\/p>\n<pre lang=\"actionscript\" line=\"1\" colla=\"+\">\r\njpgEncoder = new JPGEncoder( 100 )\t\t\t\r\n\t\t\t\r\nvar photo:ByteArray = jpgEncoder.encode( this.getBitmapData( photoBitmap) );\r\nvar thumbnail:ByteArray = jpgEncoder.encode( this.getBitmapData(thumbnailBitmap) );\r\n\t\t\t\r\nvar ml:MultipartURLLoader = new MultipartURLLoader();\r\nml.dataFormat = URLLoaderDataFormat.TEXT; \/\/ or whatever works for the response you receive back\r\n\t\t\t\r\nml.addEventListener(Event.COMPLETE, onSaveSucces);\r\nml.addVariable('someText', 'blah blah');\r\nml.addFile(photo, 'photo.jpg', 'photo');\r\nml.addFile(thumbnail, 'thumbnail.jpg', 'thumbnail');\r\nml.load('my\/server\/path\/postImage.php');\r\n<\/pre>\n<p>For more info on how to set up the php just go to the link!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oh man what a life saver this was! Super easy to implement and works awesomely so far! Multipart form data in as3 [Class version 1.2] Implementing is as easy as this: jpgEncoder = new JPGEncoder( 100 ) var photo:ByteArray = jpgEncoder.encode( this.getBitmapData( photoBitmap) ); var thumbnail:ByteArray = jpgEncoder.encode( this.getBitmapData(thumbnailBitmap) ); var ml:MultipartURLLoader = new MultipartURLLoader(); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/posts\/347"}],"collection":[{"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":4,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions\/350"}],"wp:attachment":[{"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thaylin.com\/blog\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}