file existance checker

  • Hi,

    I made a very simple plugin yet quite powerful, that allows you to check if a file (jpg, xml, ...) exist or not, so you can use it to avoid having the krpano error when file is not found, or many other things ...

    USAGE :

    first you need to include it of course

    Code
    <include url="file_exist.xml" />


    inside the action you want just call the action checkFileExist and pass as parameter the url of the file you want to check

    Code
    checkFileExist(path/to/your/file/name.png);


    take in care the path must be set from the root of your project

    then you will have a variable that stores if the file exist or not


    Code
    debug('does my file exists : ', urlExist);


    That's all as simple as that.

    Hope you enjoy this little contribution.

  • Hi,

    I have confirmed this behavior.

    If there is an image, it returns true, if there is no image, it returns urlExist, so is this correct?

    Code
    <events onxmlcomplete="checkFileExist(0.jpg); showlog(); 
    trace('does my file exists : ',urlExist);" 
    name="showlog" keep="true"/> 

    Thank you.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!