跳至內容
選單
此問題已被標幟
3389 瀏覽次數

I was working for the multiple file upload for Odoo website module.
Everything is working seamlessly fine in my local dev machine.
All the files are being uploaded and the page is being redirected to the home page.

But when I'm running the same code in my Live server all the attachments are being saved but the page is not being redirected. Tried many several ways but lost.

My console log says - ​Blocked loading mixed active content "http://mydomain.com/my/home"
considering my domain name is https://mydomain.com

Here is my controller code:

@http.route('/my/account/upload', type='http', auth="user", website=True)
def upload_files(self, **post):
    if request.httprequest.method == 'POST':
        if 'portal_attachment' in request.params:
            attached_files = request.httprequest.files.getlist('portal_attachment')
            for attachment in attached_files:
                attached_file = attachment.read()
                partner = request.env.user.partner_id
                request.env['ir.attachment'].sudo().create({
                            'name': attachment.filename,
'res_model': 'res.partner',
'res_id': partner.id,
'type': 'binary',
'datas_fname': attachment.filename,
'datas': base64.b64encode(attached_file),
})
    return request.redirect('/my/home')
​​

I don't understand how it is having mixed content of `HTTP` over `HTTPS`.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 25
6145
3
5月 25
2744
0
12月 23
2425
3
11月 23
17365
3
11月 24
25014