0

I've been through a few similar posts here, but cannot seem to find what I need.

I have a web application (HTML5 and Javascript), which has a picture taking function and I need it to then send it to some form of storage or database (preferably something like .json). I am quite new to web development so I am not very familiar with how exactly this would work.

So far I have the following code, which takes the picture and sends it using XHR.

<input id="objPic" type="file" accept="image/*" capture="camera">
<script>
 var newImage = document.getElementById('objPic');
    function sendPic()
 {
  var file = fileInput.files[0];
  var xhr = new XMLHttpRequest();
  xhr.open('POST', '/upload/path', true);
  xhr.send(file);
 }
    myInput.addEventListener('change', sendPic, false);
</script>

My Question is about how/where to send it (what do I put as a path)? What is the best way to store the images?

My webpage is using github as a host (if that is relevant in any way).

Oliver
  • 821
  • 5
  • 12
  • 28

1 Answers1

0

Unfortunately this is not really easy. As you said you need to access some form of storage, and GitHub Pages (I imagine that's what you use) doesn't provide that. Depending on your needs I see two ways forward:

Community
  • 1
  • 1
Julian Go
  • 4,442
  • 3
  • 23
  • 28