Jump to content
Gerb 233

Local XML-file: loading and saving in WebService

Recommended Posts

Hello,I have made a WebService in HTML & JavaScript. The user can edit data in this WebService, but before that a XML-file must be loaded. After the user has edited the data, the XML-file has to be saved.I want to let the user load a local (on local hard-drive) XML-file and after editing, save the XML-file to the local hard drive.My question is: how can I do that, without having security problems in the browser?Thanks in advance!Regards,Gerben

Share this post


Link to post
Share on other sites

I've never heard of a web service using HTML and JS, but anyway...You can use a server-side language such as PHP to allow the user to upload files to your server for editing, but you cannot save the file back as websites cannot access or write to the local filesystem. The best you can do is output the XML file and prompt the user to "Save As".

Share this post


Link to post
Share on other sites
I've never heard of a web service using HTML and JS, but anyway...You can use a server-side language such as PHP to allow the user to upload files to your server for editing, but you cannot save the file back as websites cannot access or write to the local filesystem. The best you can do is output the XML file and prompt the user to "Save As".
Thank you Synook!It think I get the idea:1. Upload file in PHP2. Edit the data in JavaScript (I allready got the JavaScript)3. Output the XML-file in PHP.Do you know a place where I can find example code for this. This would really help.Regards,Gerben

Share this post


Link to post
Share on other sites
1. Upload file in PHP
http://au2.php.net/manual/en/features.file-upload.php
2. Edit the data in JavaScript (I allready got the JavaScript)
Basically you get the contents of the file through PHP and echo it into the contents of a form with a textarea.
3. Output the XML-file in PHP.
http://au2.php.net/manual/en/reserved.vari....variables.posthttp://au2.php.net/manual/en/function.echo.php

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...