iFrame html PDF view "Forbidden"

Hi all, I’m trying to embed a dynamic PDF page on my site using the code below and keep on getting “Forbidden”. I have been successful in making the PDF file show in previous pages I have created, but for some reason, I am unable to do so for this website. Is there anything I am missing? Is there some permissions setting that I am unaware of?

Here is the website: https://www.chinoyarchives.com/items/Trilingual-code-switching-using-quantitative-lenses%3A-An-exploratory-study-on-Hokaglish/2016/47

Notice the word “Forbidden” in the iFrame html thing.

Help!

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

import wixData from ‘wix-data’ ;
import wixLocation from ‘wix-location’ ;
let source;
console.log (source);
console.log( “1” );

$w.onReady( function () {
console.log (source);
console.log( “2” );
$w( “#dynamicDataset” ).onReady( () => {
source = $w( “#button14” ).link;
let name = source.split( “/” )[ 4 ];
let url = source.split( “/” )[ 3 ];
$w( “#html1” ).src = (https: //docs.wixstatic.com/ugd/${url}?);
console.log (source);
console.log( “3” );
});

});

// for PDF
console.log (source);
console.log( “4” );
export function button15_click(event, $w) {
let name = source.split( “/” )[ 4 ];
[let](let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
}) [ url = source.split(](let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
}) [“/”](let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
}) [)(let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
}) [3](let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
}) ;](let url = source.split(“/”)[3];
wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf);
console.log (source);
console.log(“5”);
})
[ wixLocation.to(https:](let url = source.split("/")[3]; wixLocation.to(https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
}) [//docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
})
[ console.log (source);](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
})
[console.log(](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
}) [“5”](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
}) [);](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
})
[}](let url = source.split(“/”)[3];
wixLocation.to(`https://docs.wixstatic.com/ugd/${url}?dn=${name}.pdf`);
console.log (source);
console.log(“5”);
})

I put a console.log() statement to see what you’ve got.

This is what I did:

let url = source.split("/")[3];
console.log('url', url);

This is what I got in the console:

url https://docs.wixstatic.com/ugd/ugd?

Not sure what exactly you’ve got, but that URL looks invalid to me.

I would suggest that you put some console.log() statements in your code so that you can inspect what you’ve got, how you’re using it, and what the result is.

Hi Guys,
I´m working in a form that i collect a *.kml from the costumer and after the form is filled send a email for me and for the costumer with a link of that kml that he wrote on the form.
All of my form is right and work well, but when i receive the email with the form answers including the url, so by clicking on the url open other page with the “Forbidden” message.
Someone know how to fix it?
URL received "http://docs.wixstatic.com/ugd/9d239c_d84e093afd0e4a609f5097318fdc6e29.kml?dn=formulario.kml"code:
import {sendEmail,sendEmailWithRecipient} from ‘backend/email’ ;
$w.onReady( function () {
$w( “#dsFormularioBD” ).onAfterSave(sendFormData);
});

function sendFormData() {
//coletar arquivo enviado pelo usuário e enviar por link no formulario e email
const convertRegex = new RegExp(/wix:document://v1/([^/]+)/(.*)$/);
const item = $w( “#dsFormularioBD” ).getCurrentItem();
const matches = item.arquivo.match(convertRegex);
const documentUrl = docs.wixstatic.com/ugd/${matches[ 1 ]}?dn=${matches[ 2 ]};
//formulario correto
const subject = Formulario preenchido por: ${$w( "#tbNome" ).value};
const body = Data: ${$w( "#tbData" ).value} \rNome: ${$w( "#tbNome" ).value} \rSobrenome: ${$w( "#tbSobrenome" ).value} \rE-mail: ${$w( "#tbEmail" ).value} \rTelefone: ${$w( "#tbTelefone" ).value} \rNome da Empresa: ${$w( "#tbEmpresa" ).value} \rNome da Instituição: ${$w( "#tbNomInst" ).value} \rNome Treinamento: ${$w( "#ddTreinamento" ).value} \rTipo de Serviço: ${$w( "#tbServicos" ).value} \rMarca Equipamento: ${$w( "#ddMarcaEquipamento" ).value} \rModelo Equipamento: ${$w( "#ddItemEquipamento" ).value} \rMensagem: ${$w( "#tbMensagem" ).value} \rArquivo: ${documentUrl};
const recipient = $w( “#tbEmail” ).value;

sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));

sendEmail(subject, body)
.then(response => console.log(response));
}

Hey Ricardo,

This is an old post and is being closed. Please create a new post with your question.

Thanks!

Dara | Corvid Team