节约用PHP的ByteArray从Flex的AIR应用程序获得

编程入门 行业动态 更新时间:2024-10-17 02:58:39
本文介绍了节约用PHP的ByteArray从Flex的AIR应用程序获得的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有远程服务AIR应用程序在codeigniter。 我想保存我从AIR应用程序获得的ByteArray 但是当我保存数据,我得到空文件与正确的文件名。

所以,一定是有什么毛病我ByteArray或我的方式保存数据。 有没有人有一个想法是什么,我做错了什么? 我已经调试我送的ArrayCollection和字节组肯定是有。

公共职能uploadImage($图片) {     的foreach($形象为$ IMG)     {         $文件= $ IMG ['名称'];         $数据=新的ByteArray($ IMG ['字节']);         file_put_contents($ _ SERVER ['DOCUMENT_ROOT']'/上传/测试/'$文件,$数据);     } }

解决方案

确定为那些有兴趣谁在解决方案中,aparrently我不得不改变这种 $数据=新的ByteArray($ IMG ['字节']); 这个 $数据= $ IMG ['字节'] - >的数据;

I have an Air application with remote service in codeigniter. I'm trying to save a bytearray that I received from the Air app but when I save the data I get empty files with the correct filename.

So there must be something wrong with my bytearray or the way I save the data. Does anyone have an idea what I'm doing wrong? I've debugged the Arraycollection I sent and the bytearray is definitely in there.

public function uploadImage($image) { foreach($image as $img) { $file = $img['name']; $data = new ByteArray($img['bytes']); file_put_contents( $_SERVER['DOCUMENT_ROOT'] . '/uploads/test/' .$file, $data); } }

解决方案

Ok for those who are interested in the solution, aparrently I just had to change this $data = new ByteArray($img['bytes']); into this $data = $img['bytes’]->data;

更多推荐

节约用PHP的ByteArray从Flex的AIR应用程序获得

本文发布于:2023-11-23 16:12:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622083.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   节约   PHP   ByteArray   Flex

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!