Upload files works in FileZilla not WinSCP

Advertisement

kul2bme
Joined:
Posts:
5

Upload files works in FileZilla not WinSCP

I used FileZilla to upload a file to an SFTP site. Everything worked fine. I saved the settings to the Site Manager. I then opened WinSCP and imported the settings from FileZilla. When I tried upload another file in WinSCP with those settings I got the following error ...
Upload of file '63e31c9b-4b63-4ca0-b070-54e028a18444.txt' was successful, but error occurred while setting the permissions and/or timestamp.
If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option. ("The server does not support the operation.
Error code: 8
Error message from server (en): Operation unsupported")
I have tried adjusting the settings every way possible but either got the same error or a worse error. I ultimately want to upload using PowerShell and WinSCP but need it to work in the GUI first.

I am attaching the logs from FileZilla and WinSCP for review.
Description: I have modified the username in the log
Description: I have modified the username in the log

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
37,180
Location:
Prague, Czechia

Re: Upload files works in FileZilla not WinSCP

"I have tried adjusting the settings every way possible" does not really tell us what did you try.
So I can only point you to:
Upload of file .. was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on ‘Ignore permission errors’ option.
If it does not help, please tell us what did you try and post corresponding session log file.

Reply with quote

kul2bme
Joined:
Posts:
5

Re: Upload files works in FileZilla not WinSCP

I have tried "turn off setting permissions or preserving timestamp. Alternatively you can turn on ‘Ignore permission errors’ option." in the WinSCP app and still got the error popup screen that told me the same. I have tried adjusting permissions to all configurations except "---------" (is that turning off permissions). I thought once I figured out how to import the FileZilla settings that worked, that would be my solution. Mind you I have used WinSCP successfully with even default settings on other SFTP connections with no issue. This one is just giving me a fit and their support referred me back to their documentation which has no detail whatsoever just the basics URL, Port, username and password.

Reply with quote

kul2bme
Joined:
Posts:
5

Re: Upload files works in FileZilla not WinSCP

Here is the log file for my attempt to do "---------" and "Ignore permission errors" as well as default permissions "rwxrwxrwx" (which is what is shown on server side) and "Ignore permission errors". I still get the popup with the error message but the file does copy over.

I do not think that I stated that aspect before that the file does copy and is usable from the GUI side the DLL side the file gets cutoff at 65535 bytes and is unusable.
Description: I have edited the username in the file

Reply with quote

kul2bme
Joined:
Posts:
5

Re: Upload files works in FileZilla not WinSCP

I finally found a settings combination in the GUI that worked without the error. I have attached the edited for privacy log file. I would like to take those and covert them to the settings that would work for a PowerShell script to try to duplicate what the GUI is doing. Below is the PS scripting that I have thus far but it does not work and I am not sure how to convey the log file settings to PS settings ... Any help would be greatly appreciated.

# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll";
 
#pass the new file to secure FTP
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Sftp
    HostName = "HOSTNAME"
    UserName = "USERNAME" 
    Password = 'PASSWORD' 
    SshHostKeyFingerprint = "ssh-dss 1024 EDITED FOR PRIVACY"
    Timeout = 600
}
 
$session = New-Object WinSCP.Session;
try
{
    #$tim = Get-Date -Format HH:mm:ss
    #Write-Host "Connecting ...  " $tim
    $session.SessionLogPath = 'LOGPATH\winscp.log';
 
    ## Connect
    $session.Open($sessionOptions);
    
    $transferOptions = New-Object WinSCP.TransferOptions
    $transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
    $transferOptions.FilePermissions = $Null # This is default
    $transferOptions.PreserveTimestamp = $False
    $transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
    $transferOptions.FileMask = '*.*';
    
    ## copy file to SFTP
    $transferResult = $session.PutFiles($file270,$remotePath,$False,$transferOptions);
 
    $transferResult.Check();
    
    ##close connection
    $Session.Close()
}
finally
{
    # Disconnect, clean up
    $session.Dispose();
}

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Upload files works in FileZilla not WinSCP

Your code looks good. If it does not work, please post complete log file.

Reply with quote

Advertisement

You can post new topics in this forum