为什么我不能在 Django Web 应用程序中使用客户端相机拍摄图像快照? [英] Why I can't take image snapshot with client-side camera in Django web application?

查看:27
本文介绍了为什么我不能在 Django Web 应用程序中使用客户端相机拍摄图像快照?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Django Web 应用程序,我想在其中提供一个选项来捕获注册表单中的图像.因此,每当用户按下捕获图像按钮时,客户端系统上的相机就会打开以拍摄图像,然后图像将存储在服务器端文件夹中.

I have a Django web application in which I want to give an option to capture the image in the registration form. So, whenever the user presses the capture image button then the camera on the client system should open to take the image, the image then would get stored in the server-side folder.

我认为相机应该从 HTML 页面打开并将图像发送到服务器,但我无法使用 HTML 代码打开相机.

I am thinking that the camera should open from the HTML page and send the image to the server, but I am not able to open the camera using the HTML code.

请给我建议.

推荐答案

你可以使用 WebRTC;html5rocks.com 有 一个不错的教程,尤其是例子截屏.要将图像存储在服务器上,您必须通过 AJAX 上传.

You can use WebRTC for this; html5rocks.com has a nice tutorial, see especially the example of taking screenshots. To store the image on the server, you'll have to upload it via AJAX.

这篇关于为什么我不能在 Django Web 应用程序中使用客户端相机拍摄图像快照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆