0

Tengo el siguiente ejemplo en la vista, en el que transformo una cadena de string en base64 con btoa:

 $("#btn_ejemplo").click(function (e) {
        e.preventDefault();
        var myContent = btoa(("#myContent").text());
        var url = '/Factura/DescargarXML?textoXML=' + myContent;
        window.location.href = url;
    });

en el controlador recibo de esta forma:

 public ActionResult DescargarXML(String textoXML)
    {            
        byte[] arr = System.Text.Encoding.UTF8.GetBytes(Base64Decode(textoXML));
        var fileStreamResult = File(arr, "application/octet-stream", "DTE.xml");
        return fileStreamResult;
    }

    public static string Base64Decode(string base64Data)
    {
        var b = System.Convert.FromBase64String(base64Data);
        return System.Text.Encoding.UTF8.GetString(b);
    }

Pero cuando decodifico, se me cae diciendo que tiene error:

longitud no válida para una matriz o cadena de caracteres base-64 en System.Convert.FromBase64String(base64Data)

Esto es lo que tiene el string textoXML:

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iSVNPLTg4NTktMSI/Pgo8RW52aW9EVEUgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy5zaWkuY2wvU2lpRHRlIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6c2NoZW1hTG9jYXRpb249Imh0dHA6Ly93d3cuc2lpLmNsL1NpaUR0ZSBFbnZpb0RURV92MTAueHNkIj4KICA8U2V0RFRFIElEPSJJRDc4NDUwNDcwLTBfXzFfXzMzX18xMzcxNzUiPgogICAgPENhcmF0dWxhIHZlcnNpb249IjEuMCI CiAgICAgIDxSdXRFbWlzb3I Nzg0NTA0NzAtMDwvUnV0RW1pc29yPgogICAgICA8UnV0RW52aWE MTQ2ODE1OTYtMDwvUnV0RW52aWE CiAgICAgIDxSdXRSZWNlcHRvcj43NTgyNzUxLTI8L1J1dFJlY2VwdG9yPgogICAgICA8RmNoUmVzb2w MjAxNC0wNy0xODwvRmNoUmVzb2w CiAgICAgIDxOcm9SZXNvbD42NjwvTnJvUmVzb2w Ci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VRNYW5kYW50ZT4KICAgICAgICAgIDxSZWNlcHRvcj4KICAgICAgICAgICAgPFJVVFJlY2VwPjc1ODI3NTEtMjwvUlVUUmVjZXA CiAgICAgICAgICAgIDxSem5Tb2NSZWNlcD5IRVJOQU4gRU5SSVFVRSBTT1RPIFBJWkFSUk88L1J6blNvY1JlY2VwPgogICAgICAgICAgICA8R2lyb1JlY2VwPkRJU1RSSUJVSURPUkE8L0dpcm9SZWNlcD4KICAgICAgICAgICAgPERpclJlY2VwPk1BTlNPIERFIFZFTEFTQ08gTiAxMTY0PC9EaXJSZWNlcD4KICAgICAgICAgICAgPENtbmFSZWNlcD5DVVJJQ088L0NtbmFSZWNlcD4KICAgICAgICAgIDwvUmVjZXB0b3I CiAgICAgICAgICA8VHJhbnNwb3J0ZT4KICAgICAgICAgICAgPFBhdGVudGU QlQ4NDU1PC9QYXRlbnRlPgogICAgICAgICAgICA8Q2hvZmVyPgogICAgICAgICAgICAgIDxSVVRDaG9mZXI MTYzMzY5MzAtMzwvUlVUQ2hvZmVyPgogICAgICAgICAgICAgIDxOb21icmVDaG9mZXI TkQ8L05vbWJyZUNob2Zlcj4KICAgICAgICAgICAgPC9DaG9mZXI CiAgICAgICAgICAgIDxEaXJEZXN0PkFWIEZSRUlSRSA2ODE8L0RpckRlc3Q CiAgICAgICAgICAgIDxDbW5hRGVzdD5DVVJJQ088L0NtbmFEZXN0PgogICAgICAgICAgPC9UcmFuc3BvcnRlPgogICAgICAgICAgPFRvdGFsZXM CiAgICAgICAgICAgIDxNbnROZXRvPjEyMTg4PC9NbnROZXRvPgogICAgICAgICAgICA8VGFzYUlWQT4xOS4wMDwvVGFzYUlWQT4KICAgICAgICAgICAgPElWQT4yMzE2PC9JVkE CiAgICAgICAgICAgIDxJVkFUZXJjPjIzMTY8L0lWQVRlcmM CiAgICAgICAgICAgIDxJbXB0b1JldGVuPgogICAgICAgICAgICAgIDxUaXBvSW1wPjI4PC9UaXBvSW1wPgogICAgICAgICAgICAgIDxUYXNhSW1wPjE8L1Rhc2FJbXA CiAgICAgICAgICAgICAgPE1vbnRvSW1wPjIwOTk8L01vbnRvSW1wPgogICAgICAgICAgICA8L0ltcHRvUmV0ZW4 CiAgICAgICAgICAgIDxNbnRUb3RhbD4xNjYwMzwvTW50VG90YWw CiAgICAgICAgICA8L1RvdGFsZXM CiAgICAgICAgPC9FbmNhYmV6YWRvPgogICAgICAgIDxEZXRhbGxlPgogICAgICAgICAgPE5yb0xpbkRldD4xPC9Ocm9MaW5EZXQ CiAgICAgICAgICA8Q2RnSXRlbT4KICAgICAgICAgICAgPFRwb0NvZGlnbz4wMTwvVHBvQ29kaWdvPgogICAgICAgICAgICA8VmxyQ29kaWdvPjE8L1ZsckNvZGlnbz4KICAgICAgICAgIDwvQ2RnSXRlbT4KICAgICAgICAgIDxObWJJdGVtPkRJRVNFTDwvTm1iSXRlbT4KICAgICAgICAgIDxRdHlJdGVtPjI5Ljc1NDAwMDwvUXR5SXRlbT4KICAgICAgICAgIDxTdWJjYW50aWRhZD4KICAgICAgICAgICAgPFN1YlF0eT40MDkuNjI1NjAwPC9TdWJRdHk CiAgICAgICAgICAgIDxTdWJDb2Q UEJhc2U8L1N1YkNvZD4KICAgICAgICAgIDwvU3ViY2FudGlkYWQ CiAgICAgICAgICA8U3ViY2FudGlkYWQ CiAgICAgICAgICAgIDxTdWJRdHk NzAuNTI4NDAwPC9TdWJRdHk CiAgICAgICAgICAgIDxTdWJDb2Q SUVGPC9TdWJDb2Q CiAgICAgICAgICA8L1N1YmNhbnRpZGFkPgogICAgICAgICAgPFN1YmNhbnRpZGFkPgogICAgICAgICAgICA8U3ViUXR5PjU1OC4wMDkwMDA8L1N1YlF0eT4KICAgICAgICAgICAgPFN1YkNvZD5QVG90YWw8L1N1YkNvZD4KICAgICAgICAgIDwvU3ViY2FudGlkYWQ CiAgICAgICAgICA8U3ViY2FudGlkYWQ CiAgICAgICAgICAgIDxTdWJRdHk MTY2MDMuMDAwMDAwPC9TdWJRdHk CiAgICAgICAgICAgIDxTdWJDb2Q U3ViUFRvdGFsPC9TdWJDb2Q CiAgICAgICAgICA8L1N1YmNhbnRpZGFkPgogICAgICAgICAgPFVubWRJdGVtPkxpdHI8L1VubWRJdGVtPgogICAgICAgICAgPFByY0l0ZW0 NDA5LjYyNTYwMDwvUHJjSXRlbT4KICAgICAgICAgIDxDb2RJbXBBZGljPjI4PC9Db2RJbXBBZGljPgogICAgICAgICAgPE1vbnRvSXRlbT4xMjE4ODwvTW9udG9JdGVtPgogICAgICAgIDwvRGV0YWxsZT4KICAgICAgICA8VEVEIHZlcnNpb249IjEuMCI CiAgICAgICAgICA8REQ CiAgICAgICAgICAgIDxSRT43ODQ1MDQ3MC0wPC9SRT4KICAgICAgICAgICAgPFREPjMzPC9URD4KICAgICAgICAgICAgPEY MTM3MTc1PC9GPgogICAgICAgICAgICA8RkU MjAxOC0wMS0yMjwvRkU CiAgICAgICAgICAgIDxSUj43NTgyNzUxLTI8L1JSPgogICAgICAgICAgICA8UlNSPkhFUk5BTiBFTlJJUVVFIFNPVE8gUElaQVJSTzwvUlNSPgogICAgICAgICAgICA8TU5UPjE2NjAzPC9NTlQ CiAgICAgICAgICAgIDxJVDE RElFU0VMPC9JVDE CiAgICAgICAgICAgIDxDQUYgdmVyc2lvbj0iMS4wIj4KICAgICAgICAgICAgICA8REE CiAgICAgICAgICAgICAgICA8UkU Nzg0NTA0NzAtMDwvUkU CiAgICAgICAgICAgICAgICA8UlM U09DIENPTUVSQ0lBTCBMIFkgQyBMSU1JVEFEQTwvUlM CiAgICAgICAgICAgICAgICA8VEQ MzM8L1REPgogICAgICAgICAgICAgICAgPFJORz4KICAgICAgICAgICAgICAgICAgPEQ MTM0NjYyPC9EPgogICAgICAgICAgICAgICAgICA8SD4xMzg2NjE8L0g CiAgICAgICAgICAgICAgICA8L1JORz4KICAgICAgICAgICAgICAgIDxGQT4yMDE3LTExLTIxPC9GQT4KICAgICAgICAgICAgICAgIDxSU0FQSz4KICAgICAgICAgICA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lcnRpZmljYXRlPjwvWDUwOURhdGE PC9LZXlJbmZvPjwvU2lnbmF0dXJlPgogIAo8L0VudmlvRFRFPg==

Me llama la atención que al final tiene dos signos igual(==); le agrego o le saco el igual, pero me sale el mismo error.

1 respuesta 1

1

Es posible que algunos caracteres del B64 estén teniendo conflicto con los de una URL válida, intenta lo siguiente:

byte[] arr = System.Text.Encoding.UTF8.GetBytes(Base64Decode(textoXML.Replace(" ", "+")));
1
  • shop350 sos un capo re capo, estuve luchando con esto 2 días y tu indicación del blanco y el + era justo mi problema por algún motivo al pasarla a variable de session o no se en que pasamano la clave cambia los + por blancos y ese era mi problema. le agregue el .replace(" ","+") y solucionado el problmea Realmente me ayudaste un montón, mil gracias. Commented el 13 jun. 2019 a las 14:36

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.