Friday 21 April 2017

upload xml data file images to html page

Hi I am using node and html, I have a data file candy.xml which has paths to images as such:

<?xml version="1.0" encoding="UTF-8"?>
<candys>
<candy id="1">
<name>starburts</name>
<image>images/starburts.jpg</image>
<texture>hard</texture>
</candy>
<candy id="2">
<name>Alice in Wonderland</name>
<image>images/jolly-rancher.jpg</image>
<texture>hard</texture>
</candy>
</candys>

my index.html page just has empty img tags <img src=""> I want to be able to use an upload form on my html page to firstly add data into this file and secondly retrieve that data later on using javascript or something to display on my page. I have a rough idea how to grab the data later on probably with XML - XMLHttpRequest() but how can I upload the data into the file first? because I have to be able to upload name but the images are paths and stored else where which is kind of confusing. :)



via Mohammed

No comments:

Post a Comment