Skip to main content
Inspiring
Nov 28, 2023 11:43 AM UTC
Question

Problème d'autorisation

Good morning,
In order to be able to put an icon, I test if the file exists!
 

 

<CFIF fileExists ("#DIRV#")> <A href="../../Admin/_ebooks/Libre_Video.cfm"><img src="../../Admin/_Pictures/Video.gif" width="30" height="30" title ="Presentation Video" /></A> </CFIF>

 

But since I'm in a loop, I'm going to get negative answers! Here is the error message:

Security: The requested template has been denied access to /SoLivres/_Ouvrages/APED/Auteurs/IRLES/UNE_ENFANCE_PIEDS-NOIRS/Videos/UNE_ENFANCE_PIEDS-NOIRS.mp4.

 

The following is the internal exception message: access denied ("java.io.FilePermission" "/SoLivres/_Ouvrages/APED/Auteurs/IRLES/UNE_ENFANCE_PIEDS-NOIRS/Videos/UNE_ENFANCE_PIEDS-NOIRS.mp4" "read")

Thank you for your help.

 

Bonjour,

Afin de pouvoir mettre une icone, je teste si le fichier existe !

 

<CFIF fileExists ("#DIRV#")>
<A href="../../Admin/_ebooks/Libre_Video.cfm"><img src="../../Admin/_Pictures/Video.gif" width="30" height="30" title="Presentation Video" /></A>
</CFIF>

 

Mais comme je suis dans une boucle, je vais avoir des réponses négatives !

Voici le message d'erreur :

Security: The requested template has been denied access to /SoLivres/_Ouvrages/APED/Auteurs/IRLES/UNE_ENFANCE_PIEDS-NOIRS/Videos/UNE_ENFANCE_PIEDS-NOIRS.mp4.

The following is the internal exception message: access denied ("java.io.FilePermission" "/SoLivres/_Ouvrages/APED/Auteurs/IRLES/UNE_ENFANCE_PIEDS-NOIRS/Videos/UNE_ENFANCE_PIEDS-NOIRS.mp4" "read")

Merci de votre aide.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    BKBK
    Community Expert
    Community Expert
    Apr 3, 2024 11:47 AM UTC

    "/SoLivres/_Ouvrages/APED/Auteurs/IRLES/UNE_ENFANCE_PIEDS-NOIRS/Videos/UNE_ENFANCE_PIEDS-NOIRS.mp4" is a relative path. You have to replace it with the full path. That is, with the absolute path of the file on the server.

    Translate
    Community Expert
    Nov 28, 2023 10:21 PM UTC

    This seems like an ideal place to use CFTRY/CFCATCH:

     

    <cftry>

        ... error-prone code goes here ...

       <cfcatch type="Any">

       ... safe response goes here ...

       </cfcatch>

    </cftry>

     

    Dave Watts, Eidolon LLC

    Translate
    Dave Watts, Eidolon LLC