Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to save picture tacen from mobilen camera to my server

Posted on 2013-06-14
4
482 Views
Last Modified: 2013-07-25
Hi!

I am using HTML5, and have testet this code:

<input id="file-input" type="file" name="image" accept="tor/*" capture="camera" />

Its working fine, but i need to store the filename to my database
and the picture to my server.

Onother thing is that -> <input id="file-input" type="file" name="image" accept="tor/*" capture="camera" />
Gives me a button on mobile, how to use own button for this ?
0
Comment
Question by:team2005
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
mcnute earned 500 total points
ID: 39248046
For the imagename saving and picture storing on your server you'll need a server side scripting language. The most common is php.

The html for a button  is:

<input type="button" value="Button" />

Open in new window


For a file input with a custom button you'll need javascript. Look the links below:
http://filamentgroup.com/examples/jquery-custom-file-input/
http://filamentgroup.com/lab/jquery_custom_file_input_book_designing_with_progressive_enhancement/
0
 
LVL 2

Author Comment

by:team2005
ID: 39249672
Hi!

This code i find is good. But the image is not stored on my server ?

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HTML5 camera test</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<form>
<input id="file-input" type="file" name="image" accept="image/*" capture="camera" />
</form>
<pre id="output"></pre>
 
<script>
var input = document.getElementById("file-input");
input.addEventListener("change", function(event) {
var file = input.files[0],
img = new Image(),
reader = new FileReader();
 
document.getElementById("output").innerHTML =
file.name + "\n" +
file.type + "\n" +
file.size + " bytes\n";
 
reader.onload = function(event) {
var img = new Image();
img.width = 300;
img.src = event.target.result;
document.body.appendChild(img);
};
reader.readAsDataURL(file);
}, false);
</script>
</body>
</html>

Open in new window

0
 
LVL 2

Author Comment

by:team2005
ID: 39256002
Hi!

Is this not possible ?
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 39354264
thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question