Custom Server Setup
Set up one-click data exchange with your computer.
If you want to import data into ND1, or edit ND1 user data, you need to set up a custom server.
It’s easy to have your own server.
You need one thing:
-access to a working (HTTP) webserver under your control, with PHP enabled
If you have OS X, getting a working server is as simple as turning on Web Sharing in System Preferences | Sharing.
Once you have that, create a file somewhere under your server’s DOCROOT (~/Sites on Mac) and paste the following code into it:
<?php
$id = $_GET['clientID'];
$type = $_GET['type'];
$category = $_GET['category'];
if ($id == '' || $type == '' || $category == '') {
die('Required upload params missing');
}
$data = file_get_contents("php://input");
$uploaddir = 'uploads/';
$uploadfile = $uploaddir . $id . '_' . $type . '_' . $category . '.txt';
$fd = fopen($uploadfile, "w");
if ($fd) {
fwrite($fd, $data);
fclose($fd);
}
echo 'ok';
?>
We recommend a filename “upload.php”. It needs to have a .php extension.
Finally, create an “uploads” folder in the same folder.
You’re done on the server side.
The code above will write incoming ND1 data into a file in your uploads folder, where the filename will indicate the type of data, the folder name, and your ND1 user id.
Now, in ND1, go to the folder you want to share with your custom server, and enter a valid URL, that points to your upload.php page, into the text field. The URL depends on your local network configuration (test it out with Mobile Safari), but it’s probably going to look like this:
http://192.168.0.x/~user/upload.php
Flick the Custom Sharing URL switch to ON and the next time you tap Upload the data should go right into your uploads folder. You can then edit the data and get it back into ND1 by tapping Download.
It’s one-tap either direction, with nothing else to do!
If you want to use that same custom server per default, go to the Settings app, find ND1, and enter the same URL in the Custom Sharing URL field, under Advanced. This will serve to pre-populate the text field in the Sharing dialog.
You can always switch back to using our server by flicking the Custom Sharing URL switch back to OFF. Its setting is remembered by each folder individually.
(c) 2010 Naive Design. All rights reserved.