2007-06-01 15:00:19 image
Current code:
( fscript )
  1  #!/usr/bin/fscript
2 (NSBundle bundleWithPath:'P1.bundle') load.
3
4 page := Page alloc initWithTitle:'image'.
5 imageName := page cgi get valueForKey:'n'.
6
7 (NSFileManager defaultManager fileExistsAtPath:'_templates/images/'++imageName)
8 ifFalse:[ out println:'Status: 301 Moved Permanantly\nLocation: /\n\n'. ].
9
10 page setField:'imageName' value:imageName.
11
12 page displayFullPage.


Possible changes could make this:
( fscript )
  1  #!/usr/bin/fscript
2 (NSBundle bundleWithPath:'P1.bundle') load.
3
4 page := Page pageWithTitle:'image'.
5 imageName := page cgi get:'n'.
6
7 (FileManager fileExistsAtPath:'_templates/images/' ++ imageName)
8 ifFalse:[ page permanentlyMovedTo:'/'. ].
9
10 page display.
Leave a comment