View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Sum2002 M5 Milestone

Ask your insightful questions about the M5 milestone here!


so maybe I am doing something else wrong, but when I try to "PWS initializeAll" a little message pops up telling me my serverDirectory is incorrect... what is the format for this thing? I tired "F:\webserver" and "F:webserver:" and "F:webserver" ... its on my F drive and the directory is "webserver"... any clue why it won't start-up? Tysen

I seem to remember that you need a trailing slash. So it would be 'f:\webserver\'. However, it would probably be better not to initialize the Swiki action. Maybe a simple "initialize" insteda of "initializeAll" would do the trick. Or, edit the methods in question not to add SwikiAction. You might also want to look into Comanche, though it may be overkill. -Lex Spoon

Yes, you do need the trailing slash. Barbara Ericson



How can you do a file upload in PWS / Squeak?

Use the input html tag with the type being "file" to browse the local computer and select a file to upload. The file is uploaded as a Multipart MIME document in the http request. See http://www.htmlhelp.com/reference/html40/forms/input.html for information on using the input tag with the "file" type. See the MIMEDocument class for how to deal with a MIMEDocument. You can also look at the Commanche source code for how it handles uploads. Barbara Ericson

As Barbara mentioned above, in order to upload a file, it must be uploaded as a Multipart MIME document. This means that you must set the enctype of the form to "multipart/form-data". Unfortunately, PWS does not know how to parse POST requests that use a Content-Type of "multipart/form-data". Rather, it parses the POST request as if it always has a Content-Type (encoding) of type "application/x-www-form-urlencoded" (the default). So if you want to get to the data in a multipart form upload, you'll have to do something clever, like rewriting the parser by overriding PWS's decodeFields: method... Jim Gruen


You can file-out the code with the directory set correctly in ServerAction. Include some information when you upload your code to say what the server directory is and include any html files that you want in that directory or sub-directories. Barbara Ericson

Link to this Page