Hello all. I'm a newbie so please be kind. I have the following code <a href="<dtml-var "Temporal.basepath"><dtml-var sequence-item>"> Here I want to give my filename the file system path to it as a link. My dtml varialbles will display /home/something/file.txt but when I view my document and see the links I have http://localhost:8080/Folder/home/something/file.txt What do I need to do just to have the absolute filesystem path to the file. thanks in advance -- Gerardo Amaya gamaya@aldeacentroamerica.com *************************************** *'Computers are like air conditioners,* * they stop working when you open * * Windows' * ***************************************
Jose Gerardo Amaya Giron writes:
I have the following code
<a href="<dtml-var "Temporal.basepath"><dtml-var sequence-item>"> Apparently, this is a relative URL reference (one that does not start with a protocol, like "http:", "file:" etc.).
The URL Reference specification requires your browser to resolve relative references into absolute URLs. It must do this by prepending a base (if the reference does not start with a '/' but is not empty) or the "current" protocol (if the reference starts with '/').
Here I want to give my filename the file system path to it as a link. My dtml varialbles will display /home/something/file.txt
but when I view my document and see the links I have
http://localhost:8080/Folder/home/something/file.txt
What do I need to do just to have the absolute filesystem path to the file. You must generate an absolute URL (probably starting with "file://".
Dieter
You must generate an absolute URL (probably starting with "file://".
Dieter
Thanks Dieter This do the trick, but I can now download the files but not view them as a browser can do. What else do I need to accomplish that thanks in advance -- Gerardo Amaya gamaya@aldeacentroamerica.com *************************************** *'Computers are like air conditioners,* * they stop working when you open * * Windows' * ***************************************
Jose Gerardo Amaya Giron wrote:
Thanks Dieter This do the trick, but I can now download the files but not view them as a browser can do. What else do I need to accomplish that
What do you mean 'view them as a browser can do'? Perhaps you need to set the correct content type on the file objects? cheers, Chris
Thanks Dieter This do the trick, but I can now download the files but not view them as a browser can do. What else do I need to accomplish that
What do you mean 'view them as a browser can do'?
Perhaps you need to set the correct content type on the file objects?
Thanks for the reply Chris. That's what I need to do, but I don't know how to manage the content type, some tips please? Thanks to all -- Gerardo Amaya gamaya@aldeacentroamerica.com *************************************** *'Computers are like air conditioners,* * they stop working when you open * * Windows' * ***************************************
Jose Gerardo Amaya Giron wrote:
Thanks for the reply Chris. That's what I need to do, but I don't know how to manage the content type, some tips please?
Go to you file object in the ZMI, in the 'Edit' tab, put your required content type in the 'Content Type box and click the 'Save Changes' button. cheers, Chris
Jose Gerardo Amaya Giron writes:
Thanks Dieter This do the trick, but I can now download the files but not view them as a browser can do. What else do I need to accomplish that
What do you mean 'view them as a browser can do'?
Perhaps you need to set the correct content type on the file objects?
Thanks for the reply Chris. That's what I need to do, but I don't know how to manage the content type, some tips please? When I remember right, your files are in the file system and not inside Zope? Right?
Then, there is no easy way to access then as a browser does. You can use "LocalFS" (installation will be a bit problematic, but a recent message on a Zope mailing list has a solution), "ExtFile" or "ExternalFile". All these products allow (in different ways) to access files from inside Zope. You can also use an External Method to read and serve your files in the file system. Search the mailing list archives for "open", to get examples. Dieter
participants (3)
-
Chris Withers -
Dieter Maurer -
Jose Gerardo Amaya Giron