Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3388 Tampilan

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`.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Jul 25
6145
3
Mei 25
2742
0
Des 23
2424
3
Nov 23
17365
3
Nov 24
25014