Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP serialize - Store an image

Tags:

php

Would it be possible to write a script that gave the user the ability to upload a file (Image gif,jpg,png) and the serialize it and store as text?

Essentially the user doesn't have any storage so wouldn't be able to upload a file and store as a file, but I've hijacked a profile field that can store user specific strings.

Any help appreciated?

like image 280
CLiown Avatar asked Dec 02 '25 01:12

CLiown


1 Answers

You can encode and decode binary data (like image data) to text with with base64_encode and base64_decode.

like image 182
Otto Allmendinger Avatar answered Dec 03 '25 15:12

Otto Allmendinger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!