Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

nevil_doshi

Re: Sync Folder from Window to Linux - Uploaded file permission not change

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..

Regards,

Nevil Doshi
martin

Re: Sync Folder from Window to Linux - Uploaded file permission not change

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?
nevil_doshi

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

Hi,

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;
session.Open(sessionOptions);

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 =
session.SynchronizeDirectories(
SynchronizationMode.Remote, local folder path, remote folder path, false, false, SynchronizationCriteria.Size, option);

synchronizationResult.Check();
}