Last Updated
Viewed 15 Times
           

I create subfolders with C# under a write only root folder in a number of IIS FTP sites (multiple Servers 2008-2019). When I create the subfolder, it inherits the write-only "FTP Authorization" from it's root. How to I change the newly created subfolder's FTP Authorization to read/write with C#?

Every time I Publish changes in files to my remote server on Coda 2, the permissions change on the server and the files are broken once they go live, requiring me to open up my server control panel and globally apply full permissions every time I make a small change.

Is there anything, particularly on the server, that could be causing this behavior? Perhaps an FTP setting? I could not find anything.

Server: IIS (Windows) running Plesk

Application: Coda 2

I am trying to dump SQL Server data in .csv format on a remote FTP Server. Directly uploading files works absolutely fine. For.eg. if I upload a file as ftp://ftp.ftpservername/mySqlData.csv, the file is uploaded with ease. However, I will be running this data dump process every day on task scheduler, and each .csv file will be stored in a folder with the date as the name.

I am using WebRequest to get this done with MakeDirectory method. So in a nutshell I am able to upload files but not create new folders/directories. Is a simple Read/Write permission enough to create directories? The Ftp server is SSL enabled and Passive mode is being used to transfer data. I am using the following code to make directory but I get the eye sore (550) Access Denied error.

public static string MakeDirectory()
    {
        try
        {
            Uri ftpUri = new Uri(@"ftp://ftp3.ftpserver.com:portnum/TestFolder");
            FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpUri);
            request.Credentials = new NetworkCredential(FtpUsername, FtpPassword);
            request.Timeout = -1;
            request.UsePassive = true;
            request.UseBinary = true;
            request.KeepAlive = false;
            ServicePointManager.ServerCertificateValidationCallback = AcceptAllCertifications;
            request.Method = WebRequestMethods.Ftp.MakeDirectory;
            using (var response = (FtpWebResponse)request.GetResponse())
            {
                return ftpUri.ToString();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

We are using IIS for our ftp server and I would like to write either a c# windows service or a HTTP handler/module that would know that that a file has been ftp'd to a folder so that I can then them move it to another folder as well as updating a database.

My concern is if I do not know if the file has finished FTP (ing) to a folder then if I try to do something with it I would get a file access error.

Similar Question 4 (1 solutions) : IIS FTP 8 Home Directory Provider Won't Fire

Similar Question 5 (1 solutions) : IIS Virtual Folders Permissions per User Account

Similar Question 7 (2 solutions) : How can I upload Image ftp server asp.net mvc

Similar Question 8 (1 solutions) : overwrite file in ftp rename command

cc