Comments (5)
Sorry for the late response. I haven't had a chance to test it. But doing it manually file by file (with Recursive switch on Get-ChildItem) with CreateRemoteDirectory should work properly.
from transferetto.
from transferetto.
by manually I mean you can write some additional code that should help you. It shouldn't be more than 20 lines of code to do it.
from transferetto.
by manually I mean you can write some additional code that should help you. It shouldn't be more than 20 lines of code to do it.
Hi mate, I am trying but I am seeing different results, so I have started with few lines and uploading directories. Here is the script.
`
$Client = Connect-FTP -Server 'ftp://caqq.com' -Verbose -Username '67p' -Password 'avv33'
$sourceFolder = 'F:\New folder\2695 NSW'
$ListFiles = Get-ChildItem $sourceFolder -recurse -File -ErrorAction SilentlyContinue
$LocalDir = Get-ChildItem $sourceFolder -Directory
Foreach ($Dir in $LocalDir){
Send-FTPDirectory -LocalPath $Dir.fullname -Client $Client -RemotePath "/x11/xx/Test/Test" -Verbose
Write-Host "Uploading" $Dir
Start-Sleep -Seconds 2
}
Disconnect-FTP -Client $Client
`
When I list my $localdir this is what I get;
Directory: F:\New folder\2695 NSW
Mode LastWriteTime Length Name
d----- 24/08/2021 5:00 AM 13 Trelawney ADD
d----- 23/08/2021 8:29 PM Acoustic Report
d----- 23/08/2021 8:29 PM Architectural Drawings
d----- 24/08/2021 5:23 AM Architectural Schedules
d----- 23/08/2021 8:29 PM COSTING TOOL
d----- 23/08/2021 8:29 PM Electrical Services
d----- 23/08/2021 8:29 PM Hydraulic Services
d----- 23/08/2021 8:29 PM Lift Services
d----- 23/08/2021 8:29 PM Mechanical Services
d----- 23/08/2021 8:29 PM PPR
d----- 23/08/2021 8:29 PM Woollarah Embassy
When I check the FTP server
This is what gets uploaded from the $localdir
Addendum 01
Addendum 02
Documents
OLD TOOL
2uasdjjklaf.pdf
Directorytest.txt
WINPE10.0-DRIVERS-A23-PR4K0.CAB
The first 4 folders are actually subfolders, and the files on the root of $localdir, which I have no idea why they have got uploaded, since I haven't started to upload any files yet!!?
I will be very grateful if you could help me out.
from transferetto.
by manually I mean you can write some additional code that should help you. It shouldn't be more than 20 lines of code to do it.
Hi mate, I am trying but I am seeing different results, so I have started with few lines and uploading directories. Here is the script.
`
$Client = Connect-FTP -Server 'ftp://caqq.com' -Verbose -Username '67p' -Password 'avv33'$sourceFolder = 'F:\New folder\2695 NSW'
$ListFiles = Get-ChildItem $sourceFolder -recurse -File -ErrorAction SilentlyContinue
$LocalDir = Get-ChildItem $sourceFolder -DirectoryForeach ($Dir in $LocalDir){
Send-FTPDirectory -LocalPath $Dir.fullname -Client $Client -RemotePath "/x11/xx/Test/Test" -VerboseWrite-Host "Uploading" $Dir
Start-Sleep -Seconds 2
}
Disconnect-FTP -Client $Client
`When I list my $localdir this is what I get;
Directory: F:\New folder\2695 NSWMode LastWriteTime Length Name
d----- 24/08/2021 5:00 AM 13 Trelawney ADD
d----- 23/08/2021 8:29 PM Acoustic Report
d----- 23/08/2021 8:29 PM Architectural Drawings
d----- 24/08/2021 5:23 AM Architectural Schedules
d----- 23/08/2021 8:29 PM COSTING TOOL
d----- 23/08/2021 8:29 PM Electrical Services
d----- 23/08/2021 8:29 PM Hydraulic Services
d----- 23/08/2021 8:29 PM Lift Services
d----- 23/08/2021 8:29 PM Mechanical Services
d----- 23/08/2021 8:29 PM PPR
d----- 23/08/2021 8:29 PM Woollarah EmbassyWhen I check the FTP server
This is what gets uploaded from the $localdir
Addendum 01
Addendum 02
Documents
OLD TOOL
2uasdjjklaf.pdf
Directorytest.txt
WINPE10.0-DRIVERS-A23-PR4K0.CABThe first 4 folders are actually subfolders, and the files on the root of $localdir, which I have no idea why they have got uploaded, since I haven't started to upload any files yet!!?
I will be very grateful if you could help me out.
Please ignore this one, I got it fixed by adding "$($Dir.Name)" at the end of -RemotePath "/x11/xx/Test/Test" and it's working so far doing some testing for the files :)
from transferetto.
Related Issues (20)
- Unchanged files are always overwritten when loading a directory HOT 1
- connect-ftp Unable to find type [FluentFTP.FtpProfile]. error version 0.0.10 HOT 6
- Error: Exception calling "UploadFile" with "3" argument(s): "No such file" HOT 8
- Make functions return the status object HOT 7
- Set-FTPTracing throws an error HOT 3
- Fero HOT 2
- Send-FTPFile error HOT 10
- Not working behind a proxy HOT 4
- Connect-FTP -EncryptionMode HOT 2
- Any way to connect to SFTP using key pairs? HOT 7
- How to download all child items? HOT 2
- SFTP upload issue when folder name has a space HOT 7
- Implement SynchronizeDirectories for SFTP
- why I got this error :( HOT 1
- Connect-SFTP with Azure HOT 4
- Get-FTPChMod command gives zero as permissions result HOT 1
- is it possible to preserve file/folder properties ? HOT 1
- why I use -autoconnect but not print config? HOT 1
- Get file / directory size to create progressbar HOT 1
- Can't Download FTP File HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transferetto.