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,不做判断。所有页面都会被赋值为空。

最后修改:5年前
如果觉得我的文章对你有用,请随意赞赏

共有 1 条评论

  1. Amy 游客

    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!