Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3403 Visualizzazioni

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
lug 25
6156
3
mag 25
2750
0
dic 23
2431
3
nov 23
17370
3
nov 24
25017