对不起,如果这是重复的,我会认为它会找不到任何东西.
我有一个flex应用程序,我通过IE将数据发送回php/mysql服务器.我还没有遇到任何问题,但提前知道这可能会让我失去一些挫折和工作.通过http发布数据是否有大小限制?
本文说不:http: //www.netlobo.com/ie_form_submit.html
这个讨论是肯定的:http: //bytes.com/topic/php/answers/538226-what-maximum-limit-using-post-method
这一切都是我能在网上找到的.因此,请限制个人测试/验证号码的答案.
我想发回一个可能非常大的XML字符串(比如说高达5mb).
如果它有任何区别:浏览器将永远是IE(我们的产品需要它),帖子来自和httpService在flex,web服务器是php,DB是mySql.
嗨,我实际上是通过ajax将一个base64图像字符串发送到一个php脚本,它只解码字符串并将内容保存为.jpg文件.
但结果是空图像.
这怎么可能?
php脚本:
$uploadedPhotos = array('photo_1','photo_2','photo_3','photo_4');
foreach ($uploadedPhotos as $file) {
if($this->input->post('photo_1')){
$photoTemp = base64_decode($this->input->post('photo_1'));
/*Set name of the photo for show in the form*/
$this->session->set_userdata('upload_'.$file,'ant');
/*set time of the upload*/
if(!$this->session->userdata('uploading_on_datetime')){
$this->session->set_userdata('uploading_on_datetime',time());
}
$datetime_upload = $this->session->userdata('uploading_on_datetime',true);
/*create temp dir with time and user id*/
$new_dir = 'temp/user_'.$this->session->userdata('user_id',true).'_on_'.$datetime_upload.'/';
@mkdir($new_dir);
/*move uploaded file with new name*/
@file_put_contents( $new_dir.$file.'.jpg',$photoTemp);
}
Run Code Online (Sandbox Code Playgroud)
对于ajax来说没关系因为,echo $ photoTemp返回字符串.
我试过var_dump(@file_put_contents( $new_dir.$file.'.jpg',$photoTemp));
,它返回,bool(true)
因为图像被保存但图像中没有内容:(空图像
对于空图像,我的意思是,文件是创建和命名的,它与我传递给php的内容大小相同,但是当我尝试打开该图像进行预览时,文件无法打开,因为文件损坏或损坏类型格式
无论如何这是将照片作为base64并将其发送到php的JS:
<script type="text/javascript">
var _min_width = 470;
var _min_height = 330; …
Run Code Online (Sandbox Code Playgroud)