[Seaside] Re: serving files from seaside

Jay Hardesty jayh at panix.com
Tue Mar 21 04:44:57 UTC 2006


Thanks very much for your suggestions - yes the "=" for assignment 
operator was
just a typo, however I did try placing a "/" before the file, so the 
code
now looks like:

	| fileName |
	fileName := '/some.mid'.
	html
		attributeAt: 'src' put: fileName;
		attributeAt: 'width' put: 256;
		attributeAt: 'height' put: 20;
		attributeAt: 'controls' put: 'true';
		attributeAt: 'loop' put: 'true';
		tag: 'embed'

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: 
> request]].
> 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 
and
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 
trying
to implement a commercial site, but this obstacle is about to convince 
us
that using Smalltalk/Seaside requires more network expertise than we
possess (even though all of the the more complicated parts of the site 
have
already been successfully implemented in Seaside, frustratingly
enough).


Thanks again for any pointers at all
-Jay



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 /.
>
> Rick
>
>> 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 
>> directory?
>> Do I need to restart the HttpService on port 8080 every time a new 
>> file
>> is added to the directory.
>>
>> Suppose I want to serve a MIDI file named "some.midi", which sits in 
>> the
>> 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'.
>> 		html
>> 			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'.
>> or
>> fileName = 'http://localhost:8080/some.midi'.
>> or
>> fileName = 'http://localhost:9090/seaside/some.midi'.
>> or
>> fileName = 'http://localhost:8080/seaside/some.midi'.
>> or
>> Any of the above with "httpd" instead of "http"
>> or
>> fileName = 'http://some.midi'.
>> or
>> fileName = 'httpd://some.midi'.
>> or
>> 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 
>> Seaside?
>> Do "FileDirectory default" and "http://localhost:9090/seaside" point 
>> to the same
>> directory?
>>
>> 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,
>> Jay
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 5123 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060320/f0a6222b/attachment.bin


More information about the Seaside mailing list