<p>Check the file permissions on your uploads directory. The apache/nginx user or group should have write permission.</p>

CC BY-SA 4.0
2023-01-20T14:27:00.200Z
2023-01-20T14:27:00.200Z
Wallace
<p>When I upload image in server I get <a href="https://i.sstatic.net/E1rfA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/E1rfA.png" alt="enter image description here" /></a>:</p>
<pre><code>stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given
</code></pre>

CC BY-SA 4.0
2022-09-21T17:05:01.027Z
Hi @user13498! Is [this issue](https://craftcms.stackexchange.com/questions/39643/craft4-stream-copy-to-stream-argument-2-to-must-be-of-type-resource-bool) relevant? If not, could you detail what you’re uploading to and how it’s configured?
Matt Stein
<image><upload>
Upload Image in Craft CMS on Server
# Upload Image in Craft CMS on Server

(Asked by: username_0 on 2022-09-21)

When I upload image in server I get :
stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given

**Tags:** image, upload

> **Comments:**
> **username_1**: Hi @username_0! Is [this issue](https://craftcms.stackexchange.com/questions/39643/craft4-stream-copy-to-stream-argument-2-to-must-be-of-type-resource-bool) relevant? If not, could you detail what you’re uploading to and how it’s configured?  

---

## 1 answers

### Answer by username_2 on 2023-01-20. Score: 1

Check the file permissions on your uploads directory. The apache/nginx user or group should have write permission.


---

