uploadify头像上传302错误[新手容易理解的方法]

出现302错误,基本上就是你使用了官方自动加载方法_initialize造成的,因flash不能传递session值,你_initialize方法判断session不存在就跳转到首页,所以服务器重定向造成302错误。
解决方法

'height' : '200',
'fileTypeExts'    : '*.jpg; *.png; *.gif;',
'formData' : { 'authId' : '<{$Think.session.merchant}>' },

随意在formdata参数里传递一个键和一个值。键随意写,值则是你_initialize判断的值。设置完成后
在自动执行方法内

// 头像上传302解决方法
if(!empty($_POST['authId'])){
    $_SESSION['merchant'] = $_POST['authId'];
}

这样就可以了。意思就是判断POST传值过来authid不为空。就重新赋值给session,不做判断。所有页面都会被赋值为空。

原创文章,作者:CrazyCodes,如若转载,请注明出处:https://blog.fastrun.cn/2014/01/09/1-39/

(0)
下一篇 2014年1月19日 下午8:44

相关推荐

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

评论列表(1条)

  • Amy
    Amy 2018年11月18日 上午6:10

    I am sure this post has touched all the internet people, its really really fastidious
    article on building up new weblog. Hi there! This blog
    post could not be written much better! Reading through this post reminds me of my previous roommate!
    He always kept preaching about this. I will send
    this article to him. Fairly certain he will have a good read.
    I appreciate you for sharing! Greetings! Very useful advice in this
    particular article! It’s the little changes which will make the biggest changes.
    Many thanks for sharing!