---
title: "Discussion on \"How to access the webcam and take photos with XPages\" | Hashnode"
description: "Discussion on \"How to access the webcam and take photos with XPages\". There was a time where accessing the device webcam was only possible using Flash and obscure plugins. Enter WebRTC. Let's take a look on how to capture a still photo using the webcam and save it using XPages.\nWebRTC\n WebRTC (Web Real-Time Communicati..."
url: "https://hashnode.com/posts/how-to-access-the-webcam-and-take-photos-with-xpages/5fcf5528d639be20b2f02739"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to access the webcam and take photos with XPages](https://chrisbekas.hashnode.dev/how-to-access-the-webcam-and-take-photos-with-xpages?utm_source=hashnode&utm_medium=feed)

There was a time where accessing the device webcam was only possible using Flash and obscure plugins. Enter WebRTC. Let's take a look on how to capture a still photo using the webcam and save it using XPages. WebRTC WebRTC (Web Real-Time Communicati...

Dec 8, 2020 · 6 min read · chrisbekas.hashnode.dev  
Read the article

-   [#webrtc](https://hashnode.com/tag/webrtc)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Chris Bekas](https://hashnode.com/@chrisbekas)

@chrisbekas · Australia

  
[View profile](https://hashnode.com/@chrisbekas)

Full-stack web developer, Notes and Domino, XPages, React, NativeScript

## Responses 1

Markdown supported · ⌘↵ to post

[Steve Johnson](https://hashnode.com/@SteveUYS)

[Apr 27, 2021](https://hashnode.com/posts/how-to-access-the-webcam-and-take-photos-with-xpages/5fcf5528d639be20b2f02739/comment/60885a04d73f1a2dea28bccd)

Chris this is a great resource. Thanks for sharing. No problems creating the png file on the server, however I am trying to store the image directly in a Notes document. I haven't got there yet!

[Chris Bekas](https://hashnode.com/@chrisbekas)

[Apr 27, 2021](https://hashnode.com/posts/how-to-access-the-webcam-and-take-photos-with-xpages/5fcf5528d639be20b2f02739/comment/60885a04d73f1a2dea28bccd#reply-60889a834102cb3d97bffb69)

Thanks Steve, appreciate the feedback!

Once you have the image file on the server you can get hold of the file from the path and then embed it into a Rich Text field of your notes document, e.g.

var rtitem:NotesRichTextItem = doc.createRichTextItem("Body"); rtitem.embedObject(NotesEmbeddedObject.EMBED\_ATTACHMENT, "", "c:\\temp\\webcam.png", null); doc.save();
