[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - Problems with upload.cgi on newLISP 10.2.8

Problems with upload.cgi on newLISP 10.2.8

Q&A's, tips, howto's

Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Mon Jul 12, 2010 6:25 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Lutz » Mon Jul 12, 2010 6:55 pm

Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Mon Jul 12, 2010 8:32 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Lutz » Tue Jul 13, 2010 1:51 am

In upload.cgi (device) relates to the current STD I/O.

(read-buffer (device) buffer 1024) will read from the current stdin pipe which has been set up by Apache for the current CGI process to receive the POST data. (device) only refers to the recently opened file if explicitly set to it and as shown in the manual example.

I am not familiar with Dragonfly, but perhaps it already drained the stdin pipe? Perhaps running under Dragonfly, the POST data have to be retrieved in a different way? Somebody more familiar with Dragonfly, may be able to help you.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Tue Jul 13, 2010 8:12 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby TedWalther » Wed Jul 14, 2010 5:37 am

Yes, it looks like Dragonfly drains stdin.

I recommend you learn to use the ref* family of functions to use the POST data.

But I also agree with you on the usability of the format of $POST.

I recommended in the past that inclusion of a MIME module in the base system. The POST data is MIME data; it should be properly parsed as MIME data. It isn't hard. I regret I haven't had time to do such a module myself. And the Dragonfly author has been very vigorous in developing his vision; I don't think he really understood what I was trying to get at. MIME is the standard; it would be very useful to have a MIME module, because MIME is an excellent interchange format for self-describing data, much better than XML in many cases, and more traditional and easy to understand with a text editor than JSON.

Read about it in the following RFC's:

RFC 2045, RFC 2046, RFC 2047, RFC 4288, RFC 4289 and RFC 2049

MIME is a very very old standard, and is one of the backbone internet standards. It is a good standard. Having the capacity to parse and emit it (emitting is so trivial, a module isn't really needed) will allow us to encourage new developers to use this excellent standard, to the benefit of data interchange and the prevention of bit-rot.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 605
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Thu Jul 15, 2010 6:27 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby itistoday » Thu Jul 15, 2010 10:00 pm

Sorry, I just skimmed over this thread and saw Dragonfly mentioned. Just want to mention that Dragonfly should take care of all the uploading stuff for you, you don't need to write your own. See the documentation for the $FILES:

http://www.rundragonfly.com/dragonfly_api

$FILES is for multipart-form data.

There's also a different method of uploading data, which is basically a POST to the URL with binary data, in which case use $BINARY.
Get your groove on.
itistoday
 
Posts: 413
Joined: Sun Dec 02, 2007 5:10 pm
Location: I'm sitting right next to you. :)

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Thu Jul 15, 2010 10:19 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby itistoday » Thu Jul 15, 2010 10:27 pm

That's odd, I don't have time unfortunately to test this out immediately (in the middle of a move), but try removing the size attribute perhaps?

Also, try running it through Apache and not newlisp's server. If that doesn't work let me know (or better yet, file an issue on the ).
Get your groove on.
itistoday
 
Posts: 413
Joined: Sun Dec 02, 2007 5:10 pm
Location: I'm sitting right next to you. :)

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Thu Jul 15, 2010 10:59 pm

Thanks for your quick reply. I'm running under Apache on Linux. I took the size attribute out but the same issue still exists. I'll fiddle around with it a bit and try it on another Linux server I have and see if I can get it to work.
Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Jeremy Reimer » Tue Nov 16, 2010 11:15 pm

Jeremy Reimer
 
Posts: 19
Joined: Thu May 13, 2010 5:36 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby itistoday » Mon Nov 22, 2010 6:18 pm

Hey Jeremy, unfortunately my plate is ridiculously full at the moment, so I can't look into this—off the top of my head I'd suggest trying with Apache and see if it works there (if you're using newlisp's built-in server for this). If that doesn't help and you're able to figure out why, I'd be happy to apply any patches.
Get your groove on.
itistoday
 
Posts: 413
Joined: Sun Dec 02, 2007 5:10 pm
Location: I'm sitting right next to you. :)

Re: Problems with upload.cgi on newLISP 10.2.8

Postby Lutz » Tue Nov 23, 2010 2:28 am

Since development version 10.2.17, newLISP HTTP server works with binary contents and upload.cgi as well. But of course this assumes, that there is no preprocessing taking place with Dragonfly, so upload.cgi gets the data directly from the HTTP server.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: Problems with upload.cgi on newLISP 10.2.8

Postby shoukei » Tue Aug 30, 2016 1:43 pm

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
shoukei
 
Posts: 6
Joined: Tue Aug 30, 2016 1:29 pm

Re: Problems with upload.cgi on newLISP 10.2.8

Postby john88 » Wed Nov 30, 2016 10:08 am

I was just looking for information.
john88
 
Posts: 1
Joined: Wed Nov 30, 2016 9:50 am


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests