Gerb 233 Posted March 17, 2008 Share Posted March 17, 2008 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 Link to comment Share on other sites More sharing options...
Synook Posted March 18, 2008 Share Posted March 18, 2008 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". Link to comment Share on other sites More sharing options...
Gerb 233 Posted March 18, 2008 Author Share Posted March 18, 2008 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 Link to comment Share on other sites More sharing options...
Synook Posted March 18, 2008 Share Posted March 18, 2008 1. Upload file in PHP http://au2.php.net/manual/en/features.file-upload.php2. 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 Link to comment Share on other sites More sharing options...
Gerb 233 Posted March 18, 2008 Author Share Posted March 18, 2008 http://au2.php.net/manual/en/features.file-upload.phpBasically you get the contents of the file through PHP and echo it into the contents of a form with a textarea.http://au2.php.net/manual/en/reserved.vari....variables.posthttp://au2.php.net/manual/en/function.echo.php Thank you very much Synook!This really helped.Regards,Gerben Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.