This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 13 - Pages: 1 - Last Post: 13 Mar 23, 15:20 Last Post By: AndreWolff
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 13:15
 
  Click to reply to this thread Reply
I have see many times that after the upload of an album, you see another display as showed locally.

In the Advance tab was Page extension '.htm' used, but the output folder did contain an old 'index.html' file. The 'index.html' file apparently gets a priority over an 'index.htm' file, so that is why you see a different album.

So my request is:

Delete automatically an 'index.html' file if the album contains an 'index.htm' file and delete automatically an 'index.htm' file if the album contains an 'index.html' file.

Or remove the Page extension field and use always the '.html' extension.
JeffTucker

Posts: 8,216
Registered: 31-Jan-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 15:14   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
This is has been on my "list" for almost a decade, but with regard to switching between .html and .php. A user might have good technical reasons for making that switch.

Switching from .html to .htm is pointless.
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 15:16   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Switching from .html to .htm is pointless.
Could be, but .htm is the default value on my system.
davidekholm

Posts: 3,474
Registered: 18-Oct-2002
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 15:32   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
I'll consider this. Still haven't found out a tight way to implement it safely though.
JeffTucker

Posts: 8,216
Registered: 31-Jan-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 15:45   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
I'll consider this. Still haven't found out a tight way to implement it safely though.

I can envision a way to do it safely, but it might be very inefficient.

In short, if an output directory contains two files with the same base name, but with different extensions, kill the file whose extension doesn't match the current project setting's choice of extension. But you'd have to restrict it to the "server executable" extensions - php, html, etc. There are about 15 of them. Otherwise, the presence of mydog.html, mydog.php, and mydog.jpg would result in only one survivor, instead of two!

ETA: Even that doesn't take care of the situation in which a user switches from index.html to default.php. Without doing an ungodly amount of bookkeeping, you couldn't get that right. In that case, I'd just throw the user to the wolves. ;)
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 15:50   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Don’t make it complicated, check only for .htm and .html files.
JeffTucker

Posts: 8,216
Registered: 31-Jan-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 16:02   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
Don’t make it complicated, check only for .htm and .html files.

You don't know what PHP files are, do you?
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 16:27   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
It might be easier to pop up a warning dialogue and provide an external tool that will delete all files of a particular extension.
JeffTucker

Posts: 8,216
Registered: 31-Jan-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 10 Mar 23, 16:33   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
It might be easier to pop up a warning dialogue and provide an external tool that will delete all files of a particular extension.

I like that idea. This is not something that users would be doing regularly, switching extensions from one project to the next. It's much more likely to be a one-shot thing. Detect the switch, offer the tool, then move on, without burdening the 99.9% of users who never change these settings.
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 13 Mar 23, 12:12   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
It might be easier to pop up a warning dialogue and provide an external tool that will delete all files of a particular extension.
That is also OK, but where can I find that tool?
davidekholm

Posts: 3,474
Registered: 18-Oct-2002
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 13 Mar 23, 12:46   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
It hasn't been written yet, but here is one:

(Check out the source code. It should be very clear)
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 13 Mar 23, 12:53   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Ok, but jAlbum does not yet generate the pop-up saying that there is both a index.htm and index.html file!

If that is done I can decide to do a Make All to solve the problem without a special tool.
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 13 Mar 23, 14:53   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
The pop up is not really required, it was just an initial thought. Anyone who changes the setting before making an album won’t have the problem. Anyone who has already made an album and changes the setting must know there will be orphan files. All users really need is the tool.
AndreWolff

Posts: 1,159
Registered: 14-Dec-2007
Re: Prevent that the output folder contains an index.htm and an index.html file
Posted: 13 Mar 23, 15:20   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
The pop up is not really required, it was just an initial thought. Anyone who changes the setting before making an album won’t have the problem. Anyone who has already made an album and changes the setting must know there will be orphan files. All users really need is the tool.
I totally disagree with you!

If it is corrected automatically in jAlbum, the popup is indeed not required, but if you have to use a special tool, the popup is a must!
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums