# Put file/image to my POD

**URL:** <https://forum.solidproject.org/t/put-file-image-to-my-pod/2853>\
**Category:** Build a Solid App\
**Created:** [April 3, 2020, 1:18pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853 "2020-04-03T13:18:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@alessandro](https://forum.solidproject.org/u/alessandro)\
**Post date:** [April 3, 2020, 1:18pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853/1 "2020-04-03T13:18:29Z")

</div>

I’m trying to put an image to my personal(with react) pod but I don’t understand how to do it.  
I wrote a function that creates a document with these parameters: uri, base64 data, type.  
But I can’t view it on my pod.  
Sorry for my bad English and for the stupid question.  
Thanks in advance.

ps: These are my functions:  
"  
try{  
var reader = new FileReader();  
reader.onload = async function(event) {  
[//console.log](https://console.log)(creatore);  
const gridPath = await storageHelper.getAppGridStorage(creatore);  
var postStore = `${gridPath}post/`;  
var postPath = postStore + fileInInput.name;  
console.log("[_]PathImg: " + postPath);  
var data = event.target.result;  
 [//console.log](https://console.log)(data);  
//var data = data.replace(“data:image/png;base64,”, “”);  
 [//console.log](https://console.log)(data);  
console.log(fileInInput.type);  
await storeImageToPod(postPath, data, fileInInput.type);  
};  
reader.readAsDataURL(fileInInput);  
console.log("[_]Fine visualizzazione file.");  
}catch(e){  
console.log(e);  
}  
"  
and  
"  
export const storeImageToPod = async (documentUri, body = ‘’ , tipo) =\> {  
try {  
return createDoc(documentUri, {  
method: ‘PUT’,  
headers: {  
‘Content-Type’: tipo  
},  
body  
});  
} catch (e) {  
throw e;  
}  
};  
"

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [April 3, 2020, 2:30pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853/2 "2020-04-03T14:30:59Z")

</div>

With [Solid-File-Client](https://github.com/jeff-zucker/solid-file-client) all of that can be accomplished with

```javascript
  fileClient.copyFile( 
    "/someLocalPath/foo.png", "https://myPod/public/foo.png"
  )

```

---

<div class="post-metadata">

**Author:** ![alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@alessandro](https://forum.solidproject.org/u/alessandro)\
**Post date:** [April 3, 2020, 3:05pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853/3 "2020-04-03T15:05:42Z")

</div>

Thank you! now i try to use your suggestion!

---

<div class="post-metadata">

**Author:** ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)\
**Post date:** [April 3, 2020, 3:07pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853/4 "2020-04-03T15:07:53Z")

</div>

That example works on the command line in a nodejs script. To use it in a browser see this example: [https://jeff-zucker.github.io/solid-file-client/docs/examples/](https://jeff-zucker.github.io/solid-file-client/docs/examples/)

---

<div class="post-metadata">

**Author:** ![alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@alessandro](https://forum.solidproject.org/u/alessandro)\
**Post date:** [April 3, 2020, 3:29pm UTC](https://forum.solidproject.org/t/put-file-image-to-my-pod/2853/5 "2020-04-03T15:29:39Z")

</div>

I see the code of the example and now it works perfectly. Thanks again!
