r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

[unknown: 5]
25-Mar-2009
[4335x2]
http://www.geocities.com/cheyenne_language/
Could be useful if your looking for names for components.  ;-)
[unknown: 5]
26-Mar-2009
[4337x2]
I noticed that www.cheyenne.com goes to CA's website.  This looks 
like a marketing stradegy but does that mean the same Cheyenne as 
Doc's awesome product here?
If so, it must be flattering.
Dockimbel
26-Mar-2009
[4339x2]
Thanks for the link Paul, I'll check that site next time I need a 
name! :-)
Re MaxV: If you plan to use *only* PHP and MySQL, I think that Apache 
is a more logical choice. Cheyenne is built mainly for web application 
programming in REBOL. Support for PHP is here only to avoid installing 
another web server if you already use Cheyenne (for REBOL apps).
BrianH
27-Mar-2009
[4341]
How do you handle file uploads in Cheyenne RSP? I have a need to 
upload a file regularly. Post is fine - I don't need put.
Graham
27-Mar-2009
[4342x2]
Two ways.  If it is small enough, it is saved in the session, otherwise 
it is saved to a temp file which is accessed by the session variable.
so if request/posted is binary, then it's what was posted, but if 
it's a string, it points to a temporary file.
Dockimbel
28-Mar-2009
[4344x2]
The uploaded file is written on disk if it's size exceed 100'000 
bytes. You can change this default threshold value by using the 'post-mem-limit 
 keyword in virtual host configuration options (in %httpd.cfg).


Cheyenne can handle file uploads up to 2GB size with no noticeable 
impact on memory usage.


The temporary file is stored in an %incoming/ folder at Cheyenne's 
root. The file is deleted once the response is sent to the client, 
so in order to keep it, you have to rename it or copy it elsewhere.


You can use the %show.rsp sample script as target of a POST action 
to test it.
(...its size exceeds...)
Graham
28-Mar-2009
[4346]
If you want to access a web app from Rebol

page: open login-url ; a rsp session is sent to you
page/locals/headers/set-cookie contains the cookie

page: read/custom login-url compose/deep [ POST (auth) [ cookie: 
(cookie)]] ; where auth is your authentication string eg. "login=user&pass=mypassword"
you are now authenticated
and if you now what to access a page in the web app

page: read/custom web-app-url compose/deep [ GET "" [ cookie: (cookie)]]


where you need to use my modified http protocol that allows you to 
send cookies with read/custom
BrianH
2-Apr-2009
[4347x2]
If the file exceeds the post-mem-limit value I get an empty response 
error.
Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.

No file gets written to the %incoming/ directory, though that directory 
gets created.
I'm going to increase the post-mem-limit for now, but it would really 
help if I had the external file so I could have MySQL read it.
Graham
2-Apr-2009
[4349x2]
what build?
and did you look at the logs?
run cheyenne in verbose mode?
BrianH
2-Apr-2009
[4351x3]
The recent release build. Nothing shows up in the logs. I'll try 
verbose mode.
2/4-22:54:04.266-## Error in [uniserve] : On-received call failed 
with error: make object! [
    code: 303
    type: 'script
    id: 'expect-arg
    arg1: 'insert
    arg2: 'series
    arg3: [series! port! bitset!]
    near: [insert/part tmp/port s skip e]
    where: 'process-bounded-content
] !
This is in -vv mode. Should I post the rest of the logs forr that 
request?
BrianH
3-Apr-2009
[4354x2]
Weird, it works if I use Internet Explorer, but not Chrome.
I'm on a time limit for now so I'll increase the post mem limit by 
10x, but I need to get this fixed eventually so I'll track the error 
down.
Dockimbel
3-Apr-2009
[4356]
I'll test it with Chrome too, seems that multipart encoding is not 
exactly the same as in IE. Does it work with FF?
BrianH
3-Apr-2009
[4357x2]
I don't have enough RAM here for FF.
Netbook.
Graham
3-Apr-2009
[4359]
I run FF on my asus eeepc
BrianH
3-Apr-2009
[4360]
So could I, if I wasn't also running Cheyenne, MySQL, and my whole 
development platform.
Graham
3-Apr-2009
[4361]
sounds rather tortued
Dockimbel
3-Apr-2009
[4362]
I just tested with latest Chrome (1.0.154.53) with %www/post.html 
test script and it seems OK here, no error. I get the file(s) in 
 %incoming/ folder.
BrianH
3-Apr-2009
[4363]
It works fine. I only use IE for testing and Qtask - everything else 
I use Chrome. I know how to make a Windows machine stable :)
Dockimbel
3-Apr-2009
[4364]
Check if your FORM tags are using enctype="multipart/form-data" to 
indicate proper encoding for file uploading.
BrianH
3-Apr-2009
[4365]
Let me try upgrading Chromium and see if the problem goes away.
Dockimbel
3-Apr-2009
[4366]
Also try to use the %show.rsp as target for the FORM for debugging.
BrianH
3-Apr-2009
[4367x5]
Here's the test source:
<!doctype html>
<html><body>

<form action="blah.rsp" method="POST" enctype="multipart/form-data">
<input type="file" name="ufile" size="16" />
<input type="submit" name="usubmit" value="upload" />
</form>
</body></html>

And here's the test target:
<%=mold request/content%>


I get the same error with show.rsp, so I went with something simpler.
I'm posting a 150k file.
Same error after upgrading Chromium, here's the verbose 5 log of 
the request:


3/4-01:38:00.891-[HTTPd] ================== NEW REQUEST ==================

3/4-01:38:01.531-[HTTPd] Request Line=>POST /ecg/blah.rsp HTTP/1.1

3/4-01:38:02.109-[HTTPd] Trying phase method-support ( mod-static 
)

3/4-01:38:02.828-[HTTPd] Trying phase url-translate ( mod-static 
)
3/4-01:38:03.062-[uniserve] Calling >on-received< with {^M
Host: localhost:8080^M
Connection: keep-alive^M
Us}
3/4-01:38:03.547-[HTTPd] Request Headers=>
Host: localhost:8080
Connection: keep-alive

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 
(KHTML, like Gecko) Chrome/2.0.173.0 Safari/530.5
Referer: http://localhost:8080/ecg/blah.html
Content-Length: 153149
Cache-Control: max-age=0
Origin: http://localhost:8080

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEv3SZArZWdjyznJZ

Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,bzip2,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3



3/4-01:38:03.797-[HTTPd] Trying phase url-to-filename ( mod-alias 
)
3/4-01:38:04.031-[HTTPd] => request processed
3/4-01:38:04.766-[HTTPd] Trying phase url-to-filename ( mod-rsp )
3/4-01:38:05-[HTTPd] => request processed

3/4-01:38:05.469-[HTTPd] Trying phase url-to-filename ( mod-internal 
)

3/4-01:38:05.719-[HTTPd] Trying phase url-to-filename ( mod-static 
)
3/4-01:38:05.969-[HTTPd] => request processed

3/4-01:38:06.453-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:06.703-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:06.953-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:07.437-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:07.906-[uniserve] >> Port: 3789, low-level reading: 19980

3/4-01:38:08.391-[uniserve] Calling >on-received< with "------WebKitFormBoundaryEv3SZArZWdjyznJZ^M^/Content-"

3/4-01:38:08.875-[uniserve] >> Port: 3789, low-level reading: 16680

3/4-01:38:09.344-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:09.844-[uniserve] >> Port: 3789, low-level reading: 17520

3/4-01:38:10.312-[uniserve] >> Port: 3789, low-level reading: 1149

3/4-01:38:10.797-[uniserve] Calling >on-received< with {037.17923" 
"4429 SUNNYSLOPE RD SW" "Port Orchard" }

3/4-01:38:11.266-## Error in [uniserve] : On-received call failed 
with error: make object! [
    code: 303
    type: 'script
    id: 'expect-arg
    arg1: 'insert
    arg2: 'series
    arg3: [series! port! bitset!]
    near: [insert/part tmp/port s skip e]
    where: 'process-bounded-content
] !
3/4-01:38:11.734-[uniserve] Port closed : 127.0.0.1
It took a while - might it be a timeout?
If I increase the post-mem-limit over 150k, no error. Weird.
Dockimbel
3-Apr-2009
[4372]
What's the uploaded file name extension?
BrianH
3-Apr-2009
[4373x2]
I've tried a .r, .csv, .exe, .zip. The only thing that affects things 
is whether the file size is larger than the post-mem-limit.
.pdf too.
Graham
3-Apr-2009
[4375x2]
did you try a rebol client?
you say it only works wiih IE ?
Dockimbel
3-Apr-2009
[4377]
Weird, I've just tried uploading using Chrome various kind of file 
with size up to 10MB with no issue.
BrianH
3-Apr-2009
[4378]
I've only tested it with IE and Chromium. I never really trusted 
the REBOL http client, so I wrote my own. Let me try that.
Graham
3-Apr-2009
[4379]
read/custom is all you need ...
BrianH
3-Apr-2009
[4380x2]
Great. Just tried 458k pdf files and I get the same Error 324, but 
with no logged script error and the temp file gets left there.
This was after restarting Cheyenne after a crash. I gotta review 
the source some time :(
Graham
3-Apr-2009
[4382]
maybe your memory is just too low ....
BrianH
3-Apr-2009
[4383]
Likely so, though right now Cheyenne in verbose 5 is crashing with 
every request, failing to open its own log. I'm going to reboot.
Dockimbel
3-Apr-2009
[4384]
Does rebooting solved the issue?