Symbolic Link
Diez B. Roggisch
deets at nospam.web.de
Sat Aug 18 18:49:29 EDT 2007
mosscliffe schrieb:
> I am trying to create a link to a file, which I can then use in an
> HTML page.
>
> The system is Linux on a hosted web service, running python 2.3.
> Other than that I have no knowledge of the system.
>
> The link is created OK, but when I try to use it as filename for the
> IMG TAG, it does not get displayed. The page source of the created
> page is pointing to the link as temp/test1.jpg
>
> Any ideas ?
>
> srcFile = "temp/test2.jpg"
>
> linkFile = "temp/test1.jpg"
>
> if os.path.islink(linkFile):
> print "Link Exists", nl
> pass
> else:
> print "Making Link", nl
> os.symlink(srcFile, linkFile)
>
> print '<BR><img src="%s">the image</IMG><BR><BR>' % linkFile
>
> print '<img src="%s">the image</IMG>' % srcFile
In what environment is that script running? If it's apache, it might be
that the apache settings disallow for following links.
Diez
More information about the Python-list
mailing list