Answers.Body: <p>I found the problem which is because of a package called "Scout". I just update it and everything seems to be fine now.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-16T03:23:14.307Z
Answers.LastActivityDate: 2018-03-16T03:23:14.307Z
Answers.UserDisplayName: yu xia
Body: <p>I built up a form at the frontend to allow users to upload their avatars,my code looks like below</p>
  
  <pre><code>&lt;form method="post" accept-charset="UTF-8" enctype="multipart/form-data"&gt;
      {{ csrfInput() }}
      &lt;input type="hidden" name="action" value="users/save-user"&gt;
      &lt;input type="hidden" name="redirect" value="users/{{ currentUser.username }}"&gt;
      &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;
      ...some other fields
      &lt;input type="file" name="photo"&gt;
  
      &lt;input type="submit" value="upload"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But I got error 'Serialization of 'Closure' is not allowed' from '/Users/rain/dev/valet/tr3ndsideas/vendor/yiisoft/yii2-queue/src/serializers/PhpSerializer.php' . Any idea please </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-15T21:57:59.450Z
Comments.Text: You are using Craft 3 right? Because the photo is not an image but an asset. So you'll need to upload an asset first and connect it per id
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-15T23:11:25.587Z
Comments.Text: @RobinSchambach How can I upload an asset? I already have some asset volumes. Sorry, I'm new to Craft xD
Comments.UserDisplayName: yu xia
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-15T23:24:57.137Z
Comments.Text: Oh sorry I messed it up. You have to insert an image but it's treated like an asset afterwards. My bad, I didn't want to confuse you. I'll check this up later, as soon as I have enough time
Comments.UserDisplayName: Robin Schambach
Tags: <image><upload>
Title: Serialization of 'Closure' is not allowed when upload image
ThreadText: # Serialization of 'Closure' is not allowed when upload image
  
  (Asked by: username_0 on 2018-03-15)
  
  I built up a form at the frontend to allow users to upload their avatars,my code looks like below
  
  ```
  <form method="post" accept-charset="UTF-8" enctype="multipart/form-data">
      {{ csrfInput() }}
      <input type="hidden" name="action" value="users/save-user">
      <input type="hidden" name="redirect" value="users/{{ currentUser.username }}">
      <input type="hidden" name="userId" value="{{ currentUser.id }}">
      ...some other fields
      <input type="file" name="photo">
  
      <input type="submit" value="upload">
  </form>
  
  ```
  
  But I got error 'Serialization of 'Closure' is not allowed' from '/Users/rain/dev/valet/tr3ndsideas/vendor/yiisoft/yii2-queue/src/serializers/PhpSerializer.php' . Any idea please
  
  **Tags:** image, upload
  
  > **Comments:**
  > **username_1**: You are using Craft 3 right? Because the photo is not an image but an asset. So you'll need to upload an asset first and connect it per id  
  > **username_0**: @username_1 How can I upload an asset? I already have some asset volumes. Sorry, I'm new to Craft xD  
  > **username_1**: Oh sorry I messed it up. You have to insert an image but it's treated like an asset afterwards. My bad, I didn't want to confuse you. I'll check this up later, as soon as I have enough time  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-03-16. Score: 0
  
  I found the problem which is because of a package called "Scout". I just update it and everything seems to be fine now.
  
  
  ---
  
  