# Accessing clipboard in Perspective

**URL:** <https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 10, 2025, 12:39am UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741 "2025-01-10T00:39:53Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [January 10, 2025, 7:34pm UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741/21 "2025-01-10T19:34:43Z")

</div>

I can't even get perspective to recognize "Ctrl + v" event.

Thanks, this explains why all online app, wants a keyboard "Ctrl+v".

I tried, but this is outside my power.  
Will need a JS and Python developer.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [January 11, 2025, 12:28am UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741/22 "2025-01-11T00:28:09Z")

</div>

> [@bmusson](#):
>
> I’ll get this fixed in the next release.

Wasn't too hard, [0.5.2 is available here](https://github.com/mussonindustrial/embr/releases/tag/%40embr-modules%2Fperiscope%400.5.2).

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 13, 2025, 7:41am UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741/23 "2025-01-13T07:41:15Z")

</div>

Why would you want to target a textArea?

Are you trying to store the image and a text together?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 13, 2025, 9:32am UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741/24 "2025-01-13T09:32:29Z")

</div>

Anyways i tried to push the files from the paste event to an ondrop event on the fileupload component but didnt have much luck yet.

I dont really know how the component works, and if it has something targetable for this to trigger its onfilerecieved event.

Edit, another way:  
Def notperfect, but you should be able to do something with this. i wouldnt really use this, but i dont have time to look for something else atm.

[pasteimg.zip](https://forum.inductiveautomation.com/uploads/short-url/n74nFZ6nIE3jZXfctUGIaQwEYOs.zip) (6.2 KB)

```python

	code = """<img style='display:none' src='/favicon.ico' onload=\"
	const view = [...window.__client.page.views._data.values()].find(view => view.value.mountPath == this.parentNode.parentNode.parentNode.getAttributeNode('data-component-path').value.split('.')[0]).value; 
	window.addEventListener('paste', e => {		
		console.log(e.clipboardData.files);
		const buffer = e.clipboardData.files[0].arrayBuffer();
		buffer.then((x) => {
			console.log(x);
	    	let byteArray = btoa(String.fromCharCode(...new Uint8Array(x)));	
	    	console.log( byteArray);   
			view.custom.write('bites',byteArray);
			});		
	});
	\"></img>""".replace("\n", "").replace("\t", "")
	return code
		

```

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [January 16, 2025, 3:28am UTC](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741/25 "2025-01-16T03:28:02Z")

</div>

I am sorry.. But I am not following, I imported this, don't have idea how can I make this work?

Can someone explain further?

-edit: oh... it worked... still speechless.. Thanks.

I was doing a `system.perspective.download` but file came out empty.  
I read the documentation, it is downloading from gateway.. made sense since bytearray still in client session  
Aha! So..  
I created an upload button.. to upload to database(varbinary max)..  
then create a download(blobserver download) button..

[Previous page](https://forum.inductiveautomation.com/t/accessing-clipboard-in-perspective/100741.md?page=1)
