Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3383 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvc 25
6143
3
kvě 25
2738
0
pro 23
2423
3
lis 23
17363
3
lis 24
25013