Flatten local directories on remote server

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Flatten local directories on remote server

#1 Post by zout » 2010-03-11 09:10

Hi,

I have a directory on my local machine with a number of subdirectories. Each of these subdirectories contain files.

I need to transfer only the files in the subdirectories in 1 directory on a remote server.

An example:

LOCAL situation
Folder1\File1
Folder1\File2
Folder1\File3
Folder2\File4
Folder2\File5
Folder2\File6

desired REMOTE situation
File1
File2
File3
File4
File5
File6

Can I make some sort of filter to be able to do this? I tried filtering out directories, but then the files contained in them are ignored too.

Thanks!

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Flatten local directories on remote server

#2 Post by botg » 2010-03-11 19:05

Perhaps you can use the search function if the files have something in common you can search for.

zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Re: Flatten local directories on remote server

#3 Post by zout » 2010-03-12 08:01

botg wrote:Perhaps you can use the search function if the files have something in common you can search for.
Do you mean within FileZilla? I can't seem to find that function there...

The files all have the same extension, so that would be a good solution.

The problem with searching in Windows Explorer and dragging the search result to FileZilla is that it's extremely slow for a lot of files.

User avatar
boco
Contributor
Posts: 26914
Joined: 2006-05-01 03:28
Location: Germany

Re: Flatten local directories on remote server

#4 Post by boco » 2010-03-12 10:22

Menu Server - Search remote files... or <F3> button.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Re: Flatten local directories on remote server

#5 Post by zout » 2010-03-12 12:26

boco wrote:Menu Server - Search remote files... or <F3> button.
This is not what I need... I need a list of all the local files, not on the remote server.

Cypress
226 Transfer OK
Posts: 121
Joined: 2008-09-13 19:39
First name: J

Re: Flatten local directories on remote server

#6 Post by Cypress » 2010-03-12 15:04

zout wrote:Hi,

I have a directory on my local machine with a number of subdirectories. Each of these subdirectories contain files.

I need to transfer only the files in the subdirectories in 1 directory on a remote server.

Can I make some sort of filter to be able to do this? I tried filtering out directories, but then the files contained in them are ignored too.

Thanks!
Basically Ignore Local Path on Upload? (Relative local path)

Example:
Local Site: A:\
Remote Site: /ah/bh/ch/

So if you right clicked on 'Folder 1' in the local window and clicked upload it would become this in the queue?

Code: Select all

Local file          direction      Remote file      Size
A:\Folder 1\file1   -->          /ah/bh/ch/file1
...
A:\Folder 1\fileN   -->          /ah/bh/ch/fileN
For now: You know holding down shift allows you to select multiple files? So you could go into each of the subdirs via the local window and just select them all that way.

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Flatten local directories on remote server

#7 Post by botg » 2010-03-12 19:46

Use Windows' search functionality, select all files and drag&drop them into FileZilla.

zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Re: Flatten local directories on remote server

#8 Post by zout » 2010-03-13 13:12

Cypress wrote:
zout wrote:Hi,

I have a directory on my local machine with a number of subdirectories. Each of these subdirectories contain files.

I need to transfer only the files in the subdirectories in 1 directory on a remote server.

Can I make some sort of filter to be able to do this? I tried filtering out directories, but then the files contained in them are ignored too.

Thanks!
Basically Ignore Local Path on Upload? (Relative local path)

Example:
Local Site: A:\
Remote Site: /ah/bh/ch/

So if you right clicked on 'Folder 1' in the local window and clicked upload it would become this in the queue?

Code: Select all

Local file          direction      Remote file      Size
A:\Folder 1\file1   -->          /ah/bh/ch/file1
...
A:\Folder 1\fileN   -->          /ah/bh/ch/fileN
For now: You know holding down shift allows you to select multiple files? So you could go into each of the subdirs via the local window and just select them all that way.
I know that works. But I want to select all local folders (X folders in the example below) at once and upload the contained files all at once like this:

Code: Select all

Local file          direction      Remote file      Size
A:\Folder1\file1_1   -->          /ah/bh/ch/file1_1
...
A:\Folder1\file1_M   -->          /ah/bh/ch/file1_M

A:\Folder2\file2_1   -->          /ah/bh/ch/file2_1
...
A:\Folder2\file2_N   -->          /ah/bh/ch/file2_N

...

A:\FolderX\fileX_1   -->          /ah/bh/ch/fileX_1
...
A:\FolderX\fileX_P   -->          /ah/bh/ch/fileX_P
There are a lot of folders, so doing it manually takes too much time.

zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Re: Flatten local directories on remote server

#9 Post by zout » 2010-03-13 13:13

botg wrote:Use Windows' search functionality, select all files and drag&drop them into FileZilla.
That's my current solution, but with 100K or more files this seriously freezes Windows Explorer and FileZilla.

urchin
500 Syntax error
Posts: 12
Joined: 2010-03-23 19:13

Re: Flatten local directories on remote server

#10 Post by urchin » 2010-03-23 19:21

I don't think you can resolve this with Filezilla. Maybe a batch file containing a copy operation to a temporary directory will do the trick.

cp c:\..\*\*.<ext> c:\..\temp should do it. Just try it out in the windows command prompt (start->run-> cmd)

Note that you need quotes for directories with spaces: "c:\..\*\*.<ext>"

The * is a wildcard. Assuming from your post that you only need files with a specific extension. If the search is more complex I don't know if this is possible with the command prompt. You should search for that.

Urchin

zout
504 Command not implemented
Posts: 6
Joined: 2010-03-11 09:02
First name: Jan
Last name: van Thiel

Re: Flatten local directories on remote server

#11 Post by zout » 2010-04-06 14:57

I've found a solution. It is possible to import an xml with a list of files to queue (File -> Import...). I can automatically generate the list of local filenames and remove the directory names to get the remote filenames. I use the following xml. Improvements/suggestions are welcome.

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Queue>
        <Server>
            <Host>HOST_IP</Host>
            <Port>21</Port>
            <Protocol>0</Protocol>
            <Type>0</Type>
            <User>USERNAME</User>
            <Pass>PASSWORD</Pass>
            <Logontype>1</Logontype>
            <TimezoneOffset>0</TimezoneOffset>
            <PasvMode>MODE_DEFAULT</PasvMode>
            <MaximumMultipleConnections>0</MaximumMultipleConnections>
            <EncodingType>Auto</EncodingType>
            <BypassProxy>0</BypassProxy>
<File><LocalFile>FULL_LOCAL_PATH1</LocalFile><RemoteFile>REMOTE_PATH1</RemoteFile><RemotePath>1 0 </RemotePath><Download>0</Download><TransferMode>1</TransferMode></File>
<File><LocalFile>FULL_LOCAL_PATH2</LocalFile><RemoteFile>REMOTE_PATH2</RemoteFile><RemotePath>1 0 </RemotePath><Download>0</Download><TransferMode>1</TransferMode></File>
...
<File><LocalFile>FULL_LOCAL_PATHn</LocalFile><RemoteFile>REMOTE_PATHn</RemoteFile><RemotePath>1 0 </RemotePath><Download>0</Download><TransferMode>1</TransferMode></File>
        </Server>
    </Queue>
</FileZilla3>

Post Reply