Skip to main content
Inspiring
November 28, 2023
Question

Problème d'autorisation

  • November 28, 2023
  • 2 replies
  • 189 views
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 has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    April 3, 2024

    "/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.

    Community Expert
    November 28, 2023

    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

    Dave Watts, Eidolon LLC