Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3399 Widoki

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 25
6155
3
maj 25
2744
0
gru 23
2429
3
lis 23
17369
3
lis 24
25017