Skip to content

Instantly share code, notes, and snippets.

@smottt
Created January 31, 2012 20:08
Show Gist options
  • Save smottt/1712613 to your computer and use it in GitHub Desktop.
Save smottt/1712613 to your computer and use it in GitHub Desktop.
Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed.
<?php
public function __sleep()
{
$ref = new \ReflectionClass(__CLASS__);
$props = $ref->getProperties(\ReflectionProperty::IS_PROTECTED);
$serialize_fields = array();
foreach ($props as $prop) {
$serialize_fields[] = $prop->name;
}
return $serialize_fields;
}
@KristinaMo
Copy link

It works but if i want to change my ImageFile it doesnt work, i cant change my image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment