Forums

Create XLS file (from database) fales when index.html file is deletedd

jj135 23 Sep, 2016
Hi! We have two forms that both save the data to a database table and also generate a XLS file (export) after the DB save. So the mew data is first saved, then read back from the db table and then save to an XLS file. This works fine.

The issue is: When the output folder (where the XLS file is placed) is created by Chronoforms for the first time an index.html file is also created. When this index.html file is present in the folder, the file XLS file can be saved (overwritten) the next time a form is submitted. Just as we would like to happen. But when we delete the index.html file there is an error that says the folder can not be created and the XLS file is not saved (overwritten).

We solved this by putting the index.html file back, but why does this happen? And is this by design or a bug?

Kind regards,
Jip
jj135 23 Sep, 2016
Chronoforms V5.0.12 and Joomla 3.6.2
GreyHead 23 Sep, 2016
Hi Jip,

It's a 'feature' - ChronoForms uses the index.html file to check if the folder exists, if it doesn't find it then it tries to create the folder and that will fail if the folder already exists :-( It would be better if it checked using file_exists() but for some historic reason it doesn't do that.

What is the problem in leaving the index.html file there - most Joomla! folders have them.

Bob
jj135 23 Sep, 2016
Hi Bob,

Thanks for getting back to me on this.

Since Joomla 3.4 the htaccess file includes some code ( IndexIgnore *) that makes having index.html files in all folder unnecessary.

I think I deleted the index.html file myself at some point. Thinking they did not serve any purpose anymore.

I guess changing the plugin to use file_exists() would be a better way. Maybe this can be changed in the plugin (and maybe other plugins as well) at some point.

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