summaryrefslogtreecommitdiff
path: root/upload-org.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-08-28 23:12:10 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-08-28 23:12:10 -0400
commitf24e77857c4af0c53ac4c7db7e671c3fbf9dc67b (patch)
tree4e3f0fe3f6d0c2ab7492a06b82918d879eb7b70c /upload-org.php
A neat little weekend (well, two Fridays and a Sunday) project to 1) generate org-mode files from copy/pasted data from MS-word 2) generate Wordpress posts from such org-mode files
Diffstat (limited to 'upload-org.php')
-rw-r--r--upload-org.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/upload-org.php b/upload-org.php
new file mode 100644
index 0000000..40f403f
--- /dev/null
+++ b/upload-org.php
@@ -0,0 +1,18 @@
+<?php
+$dir = '/home/luke/j1-uploads/';
+
+$set = isset($_POST['org_data']) && isset($_POST['filename']);
+if ($set) {
+ $filename = $dir.'/'.rawurlencode($_POST['filename']).'.org';
+ $fd = fopen($filename, 'w');
+ fwrite($fd, $_POST['word_data']);
+ fclose($fd);
+ echo 'uploaded';
+} else {
+ ?>
+ <form method="post" action="upload-msword.php">
+ <input type="text" name="filename" />
+ <textarea name="org_data"></textarea>
+ </form>
+ <?php
+}