Topic "Sync Folder from Window to Linux - Uploaded file permission not change"

Author Message
[View user's profile]

Joined: 2015-12-31
Posts: 2

I am synchronize my windows folder to linux folder.

I change transfer options file permission but it remains default (rw------)

My Code is as below:

SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Ftp,
HostName = xxxxx,
UserName = xxxxx,
Password = xxxxx,

using (Session session = new Session())
session.FileTransferred += FileTransferred;

TransferOptions option = new TransferOptions();
FilePermissions filePermission = new FilePermissions();
filePermission.GroupExecute = true;
filePermission.GroupRead = true;
filePermission.GroupWrite = true;
filePermission.OtherExecute = true;
filePermission.OtherRead = true;
filePermission.OtherWrite = true;
filePermission.UserExecute = true;
filePermission.UserRead = true;
filePermission.UserWrite = true;
option.FilePermissions = filePermission;

SynchronizationResult synchronizationResult;

synchronizationResult =
SynchronizationMode.Remote, local folder path, remote folder path, false, false, SynchronizationCriteria.Size, option);

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26455
Location: Prague, Czechia
Do you expect the code to change permissions of the existing remote files? (it won't)

Or is the problem even with newly uploaded (synchronized) files?
[View user's profile]

Joined: 2015-12-31
Posts: 2
Thanks for your reply..

My issue was solved actually I am using EC2 instance and I access one folder by FTP user and also by web(www-data) so there is some issue regarding permission when new file is created by FTP user.

It is solved by changing permission of FTP user on server side.

Thanks for your time..


Nevil Doshi

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License