Hi Alex, > For a couple weeks now, I'm trying to write a little app on picolisp. Just > upload and search pdf files. It works fine when I upload and search files > from REPL. See load-pdf and find-pdf functions.
You are very close! Just a minor glitch :) > But breaks when I'm trying > to use them in web form. It gives me errors, *Query [::1] not allowed or > *Get [::1] not allowed. The reason for this is the order of declaring 'allowed' and loading the system libraries "@lib/http.l" "@lib/xhtml.l" "@lib/form.l" etc. The libraries look for *Allow, and are "permissive" if not set. If you call 'allowed' first, and *then* load the system libs (as the demo apps do), everything should be fine. > 2. Is it possible to Url rewrite in picolisp? For example I want to show > http://localhost:9911/files/book.pdf > Instead of > http://localhost:9911/db/pdfdb/blob/A/3.pdf This can be done by planting a symbolic link in "files" (%@ "symlink" 'I "db/pdfdb/blob/A/3.pdf" "files/book.pdf") You need to (allow "files/" T), and (allow (pack *Blob "A/") T) is not needed. > 3. How to choose parameters for (dbs ...) say for database performance or > size? Where can I learn about database internals? This is critical only for very large databases. Otherwise not measurable. Normally it is enough to choose 2 for small indexes (short keys (e.g. numbers or dates) *and* few entities (e.g. a dozen)), and 4 for larger indexes. For entity files you might estimate the size of typical objects (measure with the 'size' function), But this is even less critical. Just some space is wasted if chosen too small, and access times are *minimally* slower if entities occupy more than one block. > 4. Is it possible to disable all security for debug purposes and let it > access anything. Or maybe better how to debug it the right way, maybe a > little tutorial for debugging web apps. Yes. Just do not call 'allowed'. Indeed such a tutorial would be nice. Even better explained "life". I'm planning to start online meetings (in the spirit of old PilCon) perhaps this autumn. > 5. How can I select only pdf files in File Picker dialog (+UpField) and > bulk upload multiple files with progress bars for each. Or maybe just a > hint how you would've done it. I'll try to do it myself. Hmm, not sure. I have not investigated this. Perhaps you can take a look into it and tell us if you have any insights? ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe