File Super Global Array

jonabaca 18 Mar, 2010
We moved our application to a new host. Now we have this code in the On Submit Code

<!--
<?php
    foreach($_FILES as $file)
    {
        $exists = file_exists($file['tmp_name']);
        var_dump($exists);
    }
?>
-->


It results in

<!--
bool(false)
-->


Part of my requirements involves working with the uploaded files.

Now, in our previous host, it works fine. The result is true. In our new host, the result is always false.

The host tells me that there must be something in Chronoforms that deletes the file. Since it worked in our previous host, I doubted him. I'm guessing that there is a server setting we don't know that deletes the temporary file to save space.
GreyHead 18 Mar, 2010
Hi jonabaca,

From memory, ChronoForms moves (and renames) the uploaded files from the site tmp folder into the folder specified on the File uploads tab.

Just checked - it uses JFile::upload() which does a move, not a copy.

So the (bool) false message is probably correct.

Bob
jonabaca 18 Mar, 2010
Thank you.

I just find it odd that in some hosts the temp file exists and in others it does not. Well, that isn't a problem anymore.
GreyHead 18 Mar, 2010
Hi jonabaca,

Me too . . . could possibly be linked to having FTP enabled (or not) in the site, That seems to generate some strange errors from the JFile and JFolder functions.

Bob
This topic is locked and no more replies can be posted.