Reputation: 11553
I created an upload form for images, which works properly and saves files in Contents/Resources/uploads.
I now want to display those images in my web app: how do I retrieve the URL?
Upvotes: 4
Views: 713
Reputation: 1142
It is not a question of Seaside but of the Webserver you use.
If you use Apache to serve the static files, you find the mechanism described here: Mapping URLs to Filesystem Locations
If you work on Pharo, during development you could use Zinc webserver to serve static files:
ZnZincStaticServerAdaptor startOn: 8080 andServeFilesFrom: '/Path/to/the/images'
In this case the URL to upload.jpg in '/Path/to/the/images' would be for example http://localhost:8080/upload.jpg
Upvotes: 1
Reputation: 4604
You need to configure your server to serve the files from your upload directory. Either Apache or your Smalltalk web server. Then you'll probably want to use #resourceUrl:
Check out the following chapters in the Seaside book
Upvotes: 0
Reputation: 511
To display a Seaside image, you'd use...
html url: <some image resource>
...if that image is in your Seaside image, the image resource can be coded as...
html url: WAFileLibrary / #myNewImagePng
...which translates as...
html url: '/files/WAFileLibrary/myNewImage.png'
Normally a subclass of WAFileLibrary would be used for your application.
Upvotes: 1