0

localhost/test/fileprogram/ajax/checkfile.php
result is: C:/xampp/htdocs

0

Sorry it's taking a while to get there. Can you confirm this folder?

C:\xampp\htdocs\test\fileprogram\assets\files

0

It's untested code, but your ajax file C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php should now be this:-

<?php 
    echo file_exists($_SERVER['DOCUMENT_ROOT'].'/test/fileprogram/assets/files/'.$_GET['filename']) ? json_encode(array(1)) : json_encode(array(0));
?>

and called like this:-

localhost/test/fileprogram/ajax/check-file.php?filename=image25.jpg

first without the file being present, and then again, with the filename being present.

0

results for checkfile.php only is:
Notice: Undefined index: filename in C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php on line 2 [1]

localhost/test/fileprogram/ajax/checkfile.php?filename=image25.jpg
result: [1]

0

Sorry. I should have said "First, without the file being present, and then again with the file being present".

Sorry.

0

@paulkd

first w/out file
Notice: Undefined index: filepage in C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php on line 2 [0]

with file
Notice: Undefined index: filepage in C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php on line 2 [0]

thanks

0

We agreed "filename", so your call should be

localhost/test/fileprogram/ajax/check-file.php?filename=image25.jpg
0

hi paulkd, sorry was busy in other script related to this, working in parallel, however i did tried to use the 'filename' again and results to:

the image25.jpg file NOT in folder:

localhost/test/filecms_v0_9/ajax/checkfile.php

Result:
Notice: Undefined index: filename in
C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php on line 2 [1]

localhost/test/filecms_v0_9/ajax/checkfile.php?filename=image25.jpg

Result
[0]

the image25.jpg file IN the folder:

localhost/test/filecms_v0_9/ajax/checkfile.php

Result:
Notice: Undefined index: filename in
C:\xampp\htdocs\test\fileprogram\ajax\checkfile.php on line 2 [1]

localhost/test/filecms_v0_9/ajax/checkfile.php?filename=image25.jpg

Result
[1]

0

Hi kanoy83.

This is very odd indeed.
We are seeing the correct results.
But your error message references a physical path that your web address is not using - ...test\fileprogram\ajax and ...test/filecms_v0_9/ajax

0

hi paulkd,

sorry this filecms_v0_9 is the same with fileprogram, please disregard the filecms_v0_9

thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.