发送-将图像从 Flash 上传到 PHPServer-序列以及各种选项的优缺点

发布于 2024-07-27 03:39:21 字数 498 浏览 1 评论 0原文

将图像上传到支持 PHP 的服务器的方法似乎有很多,很难理解各种选项以及在什么情况下最好使用其中一种。 在前端,您可以选择是否使用 JPGencode、是否使用 ByteArray、是否进一步压缩 ByteArray。 在服务器端,假设使用 PHP,可以选择是否使用第三方远程处理(ZendAMF 或 AMFphp)以及每种方法的优缺点。

我认为无论选项如何,前端的核心步骤顺序

  1. 都会创建一个 Bitmapdata 对象,表示要上传保存到服务器的图像。
  2. 如果使用 JPG 编码,则对 BitMapdata 进行编码,如果没有,则跳过并继续执行步骤 3。

    如果使用
  3. 如果使用 ByteArray ,一个新的 byteArray 对象被实例化,并使其等于 1 或 2,如果没有,则跳过并继续执行步骤 4。

  4. 连接到服务 -upload-save 图像数据

有人可以更正和/或详细说明上述内容吗?

There seems to be so many ways of uploading images to a PHP enabled server, it is difficult to make sense of the various options and under what circumstances it is prefereable to use one over the other.
On the front end you have the option to JPGencode or not, use a ByteArray or not, further compress the ByteArray or not.
On the server side, assuming one is using PHP, there is the option of whether to use third party remoting (ZendAMF or AMFphp) or not and what the pros cons of each are.

What I see as the core sequence of steps on the front end, regardless of options

  1. A Bitmapdata object is created representing the image that is to be uploaded-saved to the server.
  2. If using JPG encoding the BitMapdata is encoded, if not skip and proceed to step 3.

  3. If using a ByteArray, a new byteArray object is instantiated and made equal to either 1 or 2, if not skip and proceed to step 4.

  4. Connect to service -upload-save image data

Can anyone correct and or elaborate on the above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滴情不沾 2024-08-03 03:39:21

我认为,最简单和自然的方法是采用 ByteArrayBitmapData (使用 getPixelssetPixels< 可以完全互换) /code>),使用 as3corelib 将其编码为 JPG 或 PNG,然后发送..在客户端编码的优点很

  1. 明显,带宽
  2. 你的数据成为一个真正的文件而不仅仅是二进制数据......你可以将它直接存储到文件系统并通过http服务器......一个BitmapData只是一个32 -bits-per-pixel块,甚至不存储图像大小...如果你想要无损,请使用PNG,否则使用JPG...

对我来说最简单的事情是使用标准 URLLoader 类将其发送到服务器。 ..数据只是在 $HTTP_RAW_POST_DATA 中...没有理由在这里使用框架,除非服务器的其余部分基于上述框架之一...

希望有所帮助。 ..

问候

back2dos

i think, the most simple and natural way is to take the ByteArray or BitmapData (which is completely interchangable using getPixels and setPixels), encode it to JPG or PNG using as3corelib and then send it ... the advantages of encoding on client side are

  1. obviously, bandwidth
  2. your data becomes a real file and is not just binary data ... you can store it to the file system directly and server it through http ... a BitmapData is just a 32-bits-per-pixel chunk, not even storing the image size ... use PNG if you want it lossless, JPG otherwise ...

most simple thing to me, would be to send it up to the server using standard URLLoader class ... data is simply in the $HTTP_RAW_POST_DATA ... there is no reason to use a framework here, unless the rest of your server is based on one of the mentioned frameworks ...

hope that helps ...

greetz

back2dos

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文