Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 创建配置文件图像上载功能_Html_Image_Mobile_File Upload - Fatal编程技术网

Html 创建配置文件图像上载功能

Html 创建配置文件图像上载功能,html,image,mobile,file-upload,Html,Image,Mobile,File Upload,我正试图在我的手机应用程序中添加个人资料图像上传功能,但我不知道该怎么做。有人能提供解决方案吗 非常感谢 这就是我现在拥有的 <form id="profilepic_form"> <fieldset id="profilepic_controls"> <div style="width: 120px; height: 100px; position: relative; background-color: #fbfbfb; border: 1px soli

我正试图在我的手机应用程序中添加个人资料图像上传功能,但我不知道该怎么做。有人能提供解决方案吗

非常感谢

这就是我现在拥有的

<form id="profilepic_form">
<fieldset id="profilepic_controls">

 <div style="width: 120px; height: 100px; position: relative; background-color: #fbfbfb;   border: 1px solid #b8b8b8; "data-controltype="image">
  <img src="https://codiqa.com/static/images/v2/image.png" alt="image" style="position:     absolute; top: 50%; left: 50%; margin-left: -16px; margin-top: -18px">

   <div style= "top:50px;"data-role="fieldcontain" data-controltype="camerainput">
    <input type="file" name="" id="camerainput1" accept="image/*" capture="camera">
   </div>

 </div>
</fieldset>
</form>

问题在于:

 <input type="file" name="" id="camerainput1" accept="image/*" capture="camera">
但一些
Android
版本也会打开摄像头而不是上传对话框,因此现代移动跨浏览器(Chrome、Firefox、mobile Safari、Safari)解决方案是删除
accept
也:

<input type="file" name="" id="camerainput1" capture>


现在你有了一个对话框,可以从
图库
文件
,任何
主机应用程序
(dropbox)和
摄像头

上传,基本上什么都没有,但我想使用jquery。我已经添加了我目前拥有的。我正在使用Codiqa进行构建。现在我正在解决Android 4(三星S3,三星笔记)的
accept=“image/*”capture
问题。这总是只打开摄像头而不是上传类型对话框。谢谢你,这很有用,但是我的主要问题是如何创建类似Facebook上传个人资料图片的内容?即选择一张图片,然后替换现有的默认图片。现在所发生的一切就是我选择了图像,但在“选择图像”按钮旁边仍然是一个很小的缩略图。我不明白你的主要问题。你能改进你的问题并添加你所有的问题代码吗?恐怕我只有这些了。我对这个很陌生。我只想创建一些类似Facebook或twitter的上传个人资料图片功能。。。
<input type="file" name="" id="camerainput1" capture>