tags:

views:

32

answers:

2

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?

+1  A: 

for storing it as text you have to remove all non-text chars using base64_encode not serialize. in other hand - if your storage can receive binary data it's preferred to store image as is (like blob type in most of rdbms)

zerkms
+3  A: 

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

Otto Allmendinger