Skip to content

Tag: base64

Unable to decode JWT tokens PHP

I tried to decode the given token with the code below. The key is supposed to be base64 encoded. However when I attempt to decode it tells me I have invalid signature. The token is generated from a system using Java and I have to decode it in PHP. Token: Decoding script It decodes just fine on with the

Can I add a base64 image to the $_FILES array?

Is there a way to add a base64 image string to the $_FILES array (the array that you get when you upload a file)? Basically, I want to fake a file upload from a base64 string. The base64 string comes from an email attachment. I don’t wish to use file_get_contents(), because I want to save the image in a database

How to base64-decode large files in PHP

My PHP web application has an API that can recieve reasonably large files (up to 32 MB) which are base64 encoded. The goal is to write these files somewhere on my filesystem. Decoded of course. What would be the least resource intensive way of doing this? Edit: Recieving the files through an API means that I have a 32MB string