Hello Jan,
the .tid file format is as follows (between the - lines):
----------------------------------------------------
field1: value of field1
field2: value of field2
content of tiddler
-----------------------------------------------------
so your file is only one line long.
the import process can also not finish, because it sees a tiddler with one
field.
hope that helps.
quaraman
Am Dienstag, 17. April 2018 23:57:20 UTC+2 schrieb Jan:
>
> Hello,
> I have been seeking for a method to allow students to post contributions
> in the form that I easily can import as a Tiddler.
> Now finally I built a very basic mechanism to post a Tiddler to a
> directory called post as a tid.
>
> It consists of two parts
>
> 1. The Upload-button (which is trancluded by a viewTemplate
> \define ExportTid() {{$(storyTiddler)$||$:/core/templates/tid-tiddler}}
>
> <$wikify name="ExTid" text=<<ExportTid>> >
> <form action="post.php" method="post">
> <span>title:<input type="text" name="title"
> value=<<storyTiddler>>></span><br>
> <span>tiddler:<input type="text" name="content" value=<<ExTid>>
> ></span><br>
> <input type="submit" value="Hochladen">
> </form>
> </$wikify>
>
>
> 2. The post.php
> <?php
> $title = $_POST['title'];
> $content = $_POST['content'];
> $postfile = fopen('post/'.$title.'.tid', "w") or die("Unable to open
> file!");
> fwrite($postfile, $content);
> fclose($postfile);
> ?>
>
> So far it generates a Tid which looks like exactly like the an exported
> .Tid-file but appear to empty when importing it to TW.
> And it closes the wiki.
>
> So there is still a quite bunch of Questions to be solved:
>
> 1. What is wrong with my .tid file?
> 2. How do I avoid the TW form being closed when calling the php?
> 3. Is there a way to trigger a TW-action with the same click that
> submits the form?
> 4. (a php-question)How can I avoid beeing pwned by someone inducing a
> php through this mechanism.
> I hope you can help me solving these things...
>
> Jan
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/eb85c7c5-c36d-4e3d-9429-bb152c31b533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.