[Seaside] Re: serving files from seaside
jayh at panix.com
Tue Mar 21 04:44:57 UTC 2006
Thanks very much for your suggestions - yes the "=" for assignment
just a typo, however I did try placing a "/" before the file, so the
now looks like:
| fileName |
fileName := '/some.mid'.
attributeAt: 'src' put: fileName;
attributeAt: 'width' put: 256;
attributeAt: 'height' put: 20;
attributeAt: 'controls' put: 'true';
attributeAt: 'loop' put: 'true';
The file "some.midi" exists in the same directory pointed to
by "FileDirectory default". And I executed the code from
the previous post:
> | ma seaside |
> seaside := WAKom default.
> ma := ModuleAssembly core.
> ma serverRoot: FileDirectory default fullName.
> ma alias: '/seaside' to: [ma addPlug: [:request | seaside process:
> ma documentRoot: FileDirectory default fullName.
> ma directoryIndex: 'index.html index.htm'.
> ma serveFiles.
> (HttpService startOn: 8080 named: 'httpd') plug: ma rootModule
after executing "WAKom startOn: 9090". The rest of the Seaside pages
requests seem to work fine, but NOT serving the file.
Is there a simple example anywhere that isolates this functionality and
demonstrates that it works in the current version of Seaside? We're
to implement a commercial site, but this obstacle is about to convince
that using Smalltalk/Seaside requires more network expertise than we
possess (even though all of the the more complicated parts of the site
already been successfully implemented in Seaside, frustratingly
Thanks again for any pointers at all
On Mar 20, 2006, at 1:51 PM, Rick Zaccone wrote:
> Have you tried
> fileName := '/some.midi'.
> That is, you need to replace = with := and the file name must be
> preceded with a /.
>> I've been unable to successfully serve any files from Seaside.
>> (I've instead been saving the streams to an FTP site, and then
>> serving from the FTP site to get around the problem...)
>> The above code snippet raises more questions for me. Does this code
>> have to be executed every time the contents of the directory changes
>> (every time a new file is produced)? Do I need to create and update
>> the files "index.htm" and "index.html" to reflect the contents of the
>> Do I need to restart the HttpService on port 8080 every time a new
>> is added to the directory.
>> Suppose I want to serve a MIDI file named "some.midi", which sits in
>> same directory pointed to by "FileDirectory default", and then have
>> my Seaside
>> page load the file into a player as follows (having started Seaside
>> and executed the HTTPServer code snippet quoted above):
>> fileName = 'some.midi'.
>> attributeAt: 'src' put: fileName;
>> attributeAt: 'controls' put: 'true';
>> tag: 'embed'.
>> Which doesn't work. I just see a question mark where the player
>> should be.
>> So, should that first line instead be:
>> fileName = 'http://localhost:9090/some.midi'.
>> fileName = 'http://localhost:8080/some.midi'.
>> fileName = 'http://localhost:9090/seaside/some.midi'.
>> fileName = 'http://localhost:8080/seaside/some.midi'.
>> Any of the above with "httpd" instead of "http"
>> fileName = 'http://some.midi'.
>> fileName = 'httpd://some.midi'.
>> fileName = 'seaside/some.midi'
>> None of these seem to work. Is it because an "index.html" file is
>> required (physically
>> located on disk at the location pointed to by "FileDirectory
>> default")? Where does
>> the disk-based file directory intersect the file directory seen by
>> Do "FileDirectory default" and "http://localhost:9090/seaside" point
>> to the same
>> I'll admit my knowledge of networking and the web is very
>> fragmentary, but hopefully
>> there's a succinct way of accomplishing this simple operation....??
>> Thanks, again, for any help,
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 5123 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060320/f0a6222b/attachment.bin
More information about the Seaside