How to Ignore Subdirectory when doing Batch Upload How to Ignore Subdirectory when doing Batch Upload
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to Ignore Subdirectory when doing Batch Upload

Started by Jim20, December 17, 2005, 11:13:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jim20

First, let me acknowledge that using FrontPage is probably not something any self-respecting web developer would do.  That said, I am not a self-respecting web developer, and I have been able to integrate Coppermine pretty well into my site, which is otherwise done via FrontPage.

Context for my issue: FrontPage automatically creates a folder in every directory in order to store additional metadata and instructions it uses for various operations.  There is no way to avoid this in FrontPage.  The folder is always titled "_vti_cnf" and FrontPage duplicates every file in the directory and places some amount of information about that file in the _vti_cnf folder within the directory (but each of the replicas is only 1kb in size).

My issue in Coppermine: Once I have uploaded my pictures to the server, I want to use "Batch Add Files" to add the new ones to Coppermine.  The problem is that Coppermine shows all the files that are in the "_vit_cnf" folder in addition to the real files in the directory I have chosen.  Since I definitely don't want these pseudo-files showing up on my site, I have to deselect all of them each time I hit this point in the batch add process.  As the number of files in the directory grows, this will become more and more problematic.

Is there any way I can tell Coppermine to ignore the subdirectory when I do a batch add?

Nibbler

You should be able to add it in here, in searchnew.php

        if (is_dir($CONFIG['fullpath'] . $folder . $file) &&
            substr($file,0,1) != "." &&
            strpos($file,"'") == FALSE &&
            strpos($file,trim($CONFIG['userpics'],'/')) === FALSE &&
            strpos($file,'edit') === FALSE &&
            strpos($file,'CVS') === FALSE) {


So add in a new condition like this:


if (is_dir($CONFIG['fullpath'] . $folder . $file) &&
substr($file,0,1) != "." &&
strpos($file,"'") == FALSE &&
strpos($file,trim($CONFIG['userpics'],'/')) === FALSE &&
strpos($file,'edit') === FALSE &&
strpos($file,'CVS') === FALSE &&
strpos($file, '_vti_cnf') === FALSE) {

Jim20

Nibbler - thanks so much for your reply.  Your solution is exactly the sort of thing I was hoping for.  Unfortunately, it doesn't seem to have done the trick.  I have no idea why - the other directories that are excluded with that bit of code ("edit" "userpics" etc.) certainly don't show up, but the _vti_cnf still does.

Any thoughts?

By the way, the _vti_cnf directory is marked as "hidden" in Windows, in case that has any bearing on the problem.

Nibbler

Ah, then you must be using the 'browsable' interface. Change this line

$iframe_hide = rawurlencode('.,..,CVS,edit,'.rtrim($CONFIG['userpics'], '/'));

to

$iframe_hide = rawurlencode('.,..,CVS,edit,_vti_cnf,'.rtrim($CONFIG['userpics'], '/'));

Jim20

Okay, very nice, we are making progress.  That did remove it from the two "Select Directory" screens at the beginning of the Batch Add process, but when I get to the "List of new files" screen, the _vti_cnf directory and all its files still show up.

Anything else we can tweak?

Gary B

I did both of the modifications above and batch upload still displays the VTI folders. I am using  1.4.2