Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP处理Flash提交的表单数据,ModSecurity错误_Php_Image_Flash - Fatal编程技术网

PHP处理Flash提交的表单数据,ModSecurity错误

PHP处理Flash提交的表单数据,ModSecurity错误,php,image,flash,Php,Image,Flash,我正在使用PHP脚本处理来自Flash应用程序的表单数据。代码如下: <?php if (isset($GLOBALS["HTTP_RAW_POST_DATA"])) { // create the target directory if it doesn't exist // $dir = ($_GET['destination']) ? $_GET['destination'] : 'images'; if (!file_exists($dir)) mkdir($di

我正在使用PHP脚本处理来自Flash应用程序的表单数据。代码如下:

<?php
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// create the target directory if it doesn't exist //   
   $dir = ($_GET['destination']) ? $_GET['destination'] : 'images';
   if (!file_exists($dir)) mkdir($dir, 0777, true);

// write the file to the target directory //        
   $fp = fopen($dir.'/'.$_GET['filename'], "wb" );
   fwrite( $fp, $GLOBALS[ 'HTTP_RAW_POST_DATA' ] );
   fclose( $fp );   
}   
else{
    echo('file data not received');
}
?>

所以我设法找到了问题和解决方案。我连续调用了两个php脚本,一个用于将图像保存到磁盘,另一个用于将项目添加到购物车。发生的情况是,购物车脚本在图像保存完成之前启动,并将停止其进程。最后我做的是在两次PHP调用之间添加一个定时的“感谢您与我们一起购物”弹出窗口。它只会持续几秒钟,但它的长度足以让图像保存脚本完成。从那以后就没有任何问题。

两个版本之间有什么区别?他们是否以不同的方式处理数据,或者使用较大的图像,或者。。。?如果为每个图像创建一个新的dir(仅用于测试),会发生什么。images/pictureone.jpg/pictureone.jpg今天对此进行了测试。像以前一样,我可以通过大约2,直到它开始抛出Mod Security错误。然而,与以前不同的是,如果我再等一分钟左右,我可以再处理2篇帖子,直到它再次出错。以前,它会完全停止工作。那么,进步?还有其他人有什么建议吗?