Zinc as static file server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Zinc as static file server

Paul DeBruicker
Ahh.  Must be absolute file paths then.  Sorry to send you down the
wrong path




On 09/06/2013 01:11 PM, Dave wrote:

> Paul DeBruicker wrote
>> Oh and I don't think it will give a directory listing.  Not sure but you
>> might stick a file in that testDir and see if you can access it.
>
> No way.
>
> * I created testDir under the image file.
> * The script is ZnZincStaticServerAdaptor startOn: 8080 andServeFilesFrom:
> 'testDir'.
> * I put a file image.jpg under testDir
> * I point the browser at http://localhost:8080/image.jpg
>
> Response: "Not Found /testDir/image.jpg"
>
> Davide
>
>
>
> --
> View this message in context: http://forum.world.st/Zinc-as-static-file-server-tp4571413p4706989.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Zinc as static file server

Sven Van Caekenberghe-2
In reply to this post by Dave
Hi Dave,

On 06 Sep 2013, at 22:29, Dave <[hidden email]> wrote:

> Got it!
> I was wrong, I pointed the browser to
> http://localhost:8080/testDir/image.jpg/ instead of
> http://localhost:8080/image.jpg/
> Eventually I dig into the code and I discovered debugging
> ZnStaticFileServerDelegate>>actualFilenameFor:

It is not the most beautiful of methods, but it is a crucial one for static file serving. There is indeed a difference between the URI/URL you're asking for and the directory on the file system where the file is found - the prefix part can be different.

> Sorry to have bugged you.

Asking questions is OK.

Sven

> Dave
>
>
> Dave wrote
>>
>> Paul DeBruicker wrote
>>> Oh and I don't think it will give a directory listing.  Not sure but you
>>> might stick a file in that testDir and see if you can access it.
>> No way.
>>
>> * I created testDir under the image file.
>> * The script is ZnZincStaticServerAdaptor startOn: 8080 andServeFilesFrom:
>> 'testDir'.
>> * I put a file image.jpg under testDir
>> * I point the browser at http://localhost:8080/image.jpg
>>
>> Response: "Not Found /testDir/image.jpg"
>>
>> Davide
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/Zinc-as-static-file-server-tp4571413p4706994.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Zinc as static file server

Dave
I dug further and I discovered that:

* On Pharo2 you can specify absolute or relative path. Everything's fine.
* On Pharo1.4 relative path does not work! Try it and then open your browser on the chosen url, you gonna receive: InvalidDirectoryError. Indeed if you debug the, now, well-known method actualFilenameFor: you'll see the temporary variable subDir has the slash ahead even if you specify a relative path.  Diabolic :-) :-)

Dave
12