Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - shoukei

#1
Quote from: "Lutz"More changes. This works on macOS for your data and test-code and for upload.cgi without file corruption:

http://newlisp.nfshost.com/downloads/development/inprogress/">http://newlisp.nfshost.com/downloads/de ... nprogress/">http://newlisp.nfshost.com/downloads/development/inprogress/



Not tested yet on Windows and Linux.


Thanks Lutz!



Everything works now.
#2
newLISP newS / Uploading doesn't work now
March 25, 2018, 08:33:46 PM
Quote from: "Lutz"Your code will work with v10.7.4 like in v10.7.1 here:

http://newlisp.org/downloads/development/inprogress/">http://newlisp.org/downloads/development/inprogress/



See the paragraph about synchronizing file positions from stream and raw file access:

http://newlisp.org/downloads/development/inprogress/CHANGES-10.7.4.txt">http://newlisp.org/downloads/developmen ... 10.7.4.txt">http://newlisp.org/downloads/development/inprogress/CHANGES-10.7.4.txt


Thank you Lutz for the fix.



Reading the tsv file now works great.



But uploading doesn't work again like what happened some time ago. The uploaded file is corrupt.

I remember that was related to 'seek' also.

http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=2&t=4870&p=23967&hilit=shoukei#p23965">//http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=2&t=4870&p=23967&hilit=shoukei#p23965



Best Regards,

Shoukei
#3
Hello,



I am reading a tsv file into an array but I'm getting "ERR: invalid list index in function set"

in newLISP 10.7.4. and 10.7.3.



(setq addrlist (array 27000 4))
(setq filename "zenkoku2.tsv")

(set 'data-file (open filename "read"))
(setq NR 0)
(while (read-line data-file)
       (setq thisline (current-line))
       (setq thisline (parse thisline "t" 0))
       (println NR)
       (println thisline)
       (setq (addrlist NR 0) (thisline 0))
       (setq (addrlist NR 1) (thisline 1))
       (setq (addrlist NR 2) (thisline 2))
       (setq (addrlist NR 3) (thisline 3))
       (inc NR)
       )
(close data-file)


But it works with version 10.7.2.

I don't know why it doesn't work with the latest versions.



Thanks.
#4
Quote from: "Lutz"Thanks Shoukei for catching this. Fixing seek and search for mixed file-stream / raw-handle operations was not done right.



Fixed here: http://www.newlisp.org/downloads/development/inprogress/">http://www.newlisp.org/downloads/develo ... nprogress/">http://www.newlisp.org/downloads/development/inprogress/


Thanks Lutz for the quick response and fix!!
#5
Hello Lutz,



File upload script stopped working with the stable newLISP v.10.7.1 Jan. 30, 2017 version.

It finishes uploading the files but the file is corrupt. (tried with pdf and xlsx files)



It worked with the development version v10.7.1 Oct. 6, 2016 version.

I am using OS X 10.10.5





I like using newLISP. It''s very cool!!

I am now having 17 newLISP web servers running where I work!



Thank you.

Shoukei
#6
The latest reply was somewhat nearly 6 years ago but anyway I found a fix that seems to work everyone!!



Change the two lines in

dragonfly-newlisp/example-site/dragonfly-framework/lib/request.lsp

lines 142-143



142 - (if (set 'val (regex-captcha (string var {="(.+?)"}) disp))

142 + (if (set 'val (regex-captcha (string "filename" {="(.+?)"}) disp))

143 - ($FILES var (list (list 'name val) (list 'data data) (list 'length (length data))))

143 + ($FILES val (list (list 'name var) (list 'data data) (list 'length (length data)))



Then, the following works as commented in the source.(line 49 of request.lsp)

;; use like this: (lookup 'data ($FILES "filename"))

;; Valid keys: 'data, 'name, 'length



The number of files uploaded can be obtained by (length ($FILES)).

The name of each file can be obtained by (first (nth i ($FILES))) where i is the number starting from 0 for file1 and 1 for file2 ...



I'm running

OSX10.10.5, newLISP v.10.7.1, —()o Dragonfly WEB FRAMEWORK VERSION 0.73