0

Let me start by saying PHP isn't my forte, I'm usually reluctant to try working with it because of problems exactly like this. The code works fine on my local machine under MAMP and on my server, but doesn't on the clients server :'(

So what am I trying to do, well - save an image from Flash onto the server, simple right?!

I'm using the method described on this site here: http://designreviver.com/tutorials/actionscript-3-jpeg-encoder-revealed-saving-images-from-flash/ but have made a small alteration so that instead of echoing the jpg causing the browser to download it locally, I do an fwrite and an fclose to save it to the server.

Here is my PHP:

I've dona a phpinfo() on my clients server and it's running 5.2.2 my host is running 5.2.11 I don't know if much can have changed in those 9 minor revisions?

I've also read another question on here which suggests making suer always_populate_raw_post_data is set to ON, but it's set to OFF on all of the server environments I've been testing in. I'm doing some XML saving using file_get_contents('php://input') which I've tried but failed to get working with images.

Any help would be gratefully received, I'm happy to post the AS3 as well but it's EXACTLY the same as example I've linked above and works locally. As far as I can tell the problem lies with the PHP.

Cheers.

4

1 回答 1

0

您使用 HTTP_RAW_POST_DATA 有什么原因吗?$_FILES如果 Flash 通过 POST 方法发送文件,那么使用数组会容易得多。没有必要 fopen/fwrite,因为文件已经被 PHP 卡在了临时目录中。您所要做的就是[move_uploaded_file()][1]将它放在服务器上您想要的任何位置。

于 2010-04-12T22:04:25.257 回答