Hi,
I wonder if anyone has any experience using Oz for cgi-bin servlets?
I've already successfully created one to give a solution for n-queens
for a submitted board size so I know I can use the facility properly.
What I'm now trying to do is create an 'upload-file' servlet in oz.
As far as I understand the operation of cgi (and I'm no expert!), in the
case of file uploads the data for the file itself is passed via the
servlets stdin.
So, I have the following functor definition:
%%cgi-bin program to accept file uploads
functor
import
Open
Application
OS
define
StdIn={New Open.file init(name:stdin flags:[read])}
Env={StdIn read(list:$)}
Out={New class $
from Open.file Open.html
end
init(name:stdout)}
%% Print MIME content header
{Out header}
{Out tag(html(head(title('Upload files using Oz'))
body(bgcolor:'#f0f0e0'
h1('Oz file upload')
p('The data received was:'#Env)
)))}
{Application.exit 0}
end
I'm not currently worried about what actually is received, I'd be happy
at the moment to see anything coming into 'Env'. My problem is that I
appear to be receiving nil. The servlet executes but nothing appears
after "The data received was:".
The difficulty is that I can't see any way of debugging this except
executing it through the web server, so I don't know if 'something' has
been received or not.
Any advice would be gratefully received.
Regards
Mark
--
Mark Richardson MBCS
Email: [email protected]
Skype: mark.richardson.
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users