Filepicker data without "data:mimetype"

The Filepicker.files[0].Data delivers the following value:

e.g.
“data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,UEsDBBQABgAIAAAAIQC5S5U4eQEAAFYGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA…”

i need the value without “data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,”

just know i use and it worked:
{{FilePicker.files[0].data.replace(“data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,”, “”)}}

but if the mimetype ist changed it isn´t working. Is there a better way to do this?

thx.
Franz

Hey! I suppose you could do this by using regex with replace -

data.replace(“/data:.*base64,/g”, “”)

Hi,

i tried:

{{FilePicker.files[0].data.replace("/data:.*base64,/g", “”)}}

but the result is the full value.


Take a look :point_up_2:

1 Like

ah ok regex without quotes “” :crazy_face: :woozy_face:

{{FilePicker.files[0].data.replace(/data:.*base64,/g, “”)}}

thank you!!! :+1: