sftp

List files inside ZIP file located on SFTP server in C#

风格不统一 提交于 2021-02-08 09:17:41
问题 I need to process folders inside a ZIP file from SFTP server (WinSCP) programmatically through ASP.NET Core. Is there any way where I can get list of files inside ZIP file without downloading to local computer? As the file size would be high and won't be in a consistent manner. Any help would be appreciated. 回答1: With SSH.NET library, it could be as easy as: using (var client = new SftpClient(host, username, password) { client.Connect(); using (Stream stream = client.OpenRead("/remote/path

SFTP upload in VBA

我们两清 提交于 2021-02-08 07:58:27
问题 Dode below doesn't return an error, or "success" or "fail" but it also doesn't work - information in the sub TestUpload that is CAPITALIZED is the only info that i changed to make this post - everything else is legit - thanks in advance. Option Compare Database Private Const FTP_TRANSFER_TYPE_UNKNOWN As Long = 0 Private Const INTERNET_FLAG_RELOAD As Long = &H80000000 Private Declare Function InternetOpenA Lib "wininet.dll" ( _ ByVal sAgent As String, _ ByVal lAccessType As Long, _ ByVal

How to add confirm in shell script in sftp mode [duplicate]

天涯浪子 提交于 2021-02-08 07:45:23
问题 This question already has answers here : How can I force ssh to accept a new host fingerprint from the command line? (6 answers) Closed 1 year ago . I have a shell script which is performing some renaming and archiving steps. I have added sftp commands to copy multiple files. But when i try to login to the remote machine thru putty it asks for confirmation like Are you sure you want to continue connecting (yes/no)? . I need to enter yes. but since this is being done thru the script am not

When uploading memory stream with contents created by csvhelper using SSH.NET to SFTP server, the uploaded file is empty

一世执手 提交于 2021-02-08 07:28:31
问题 I'm truing to send a CSV with csvhelper. But when I send it, it is always empty. using (var sftProvider =new SFTProvider(Configuration)) using (var csvProvider=new CSVProvider(Configuration)) using (Stream fileStream = new MemoryStream()) { var sftp = sftProvider.SFTPConnection("", "", ""); var nameFile = "/ethias/"+DateTime.Now.ToString(DateFormatConstants.DATE_FORMAT) + ".csv"; if (sftp.Exists(nameFile)) { sftProvider.ReadFileSFTP(sftp, nameFile, fileStream); } await csvProvider.WriteCsv

Opening Astropy FITS file from SFTP server

孤人 提交于 2021-02-08 03:30:23
问题 I have a Python script that ssh into a remote server using Paramiko module. The below is my script import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect("host", username="McMissile") A FITS file on a local machine is usually opened as follows: from astropy.io import fits hdu = fits.open('File.fits') I was wondering how would I open a FITS file from the SFTP server machine and store it under the variable hdu in the local machine. I

With pysftp or Paramiko, how can I get a directory listing complete with attributes?

允我心安 提交于 2021-02-08 02:17:52
问题 As the title says, I'm trying to get a list of all the files and directories in a directory, including their attributes (I'm looking for at least name, size, last modified, and is it a file or a folder). I'm using Python 3 on Windows. I've tried listdir() , and I get a list of files without attributes. I've tried listdir_attr() , and I get a list of attributes, but no filenames - and I don't see anything that guarantees that those two lists will be in the same order, so as far as I know, I

With pysftp or Paramiko, how can I get a directory listing complete with attributes?

点点圈 提交于 2021-02-08 02:16:45
问题 As the title says, I'm trying to get a list of all the files and directories in a directory, including their attributes (I'm looking for at least name, size, last modified, and is it a file or a folder). I'm using Python 3 on Windows. I've tried listdir() , and I get a list of files without attributes. I've tried listdir_attr() , and I get a list of attributes, but no filenames - and I don't see anything that guarantees that those two lists will be in the same order, so as far as I know, I

With pysftp or Paramiko, how can I get a directory listing complete with attributes?

不羁的心 提交于 2021-02-08 02:16:02
问题 As the title says, I'm trying to get a list of all the files and directories in a directory, including their attributes (I'm looking for at least name, size, last modified, and is it a file or a folder). I'm using Python 3 on Windows. I've tried listdir() , and I get a list of files without attributes. I've tried listdir_attr() , and I get a list of attributes, but no filenames - and I don't see anything that guarantees that those two lists will be in the same order, so as far as I know, I

With pysftp or Paramiko, how can I get a directory listing complete with attributes?

拜拜、爱过 提交于 2021-02-08 02:13:20
问题 As the title says, I'm trying to get a list of all the files and directories in a directory, including their attributes (I'm looking for at least name, size, last modified, and is it a file or a folder). I'm using Python 3 on Windows. I've tried listdir() , and I get a list of files without attributes. I've tried listdir_attr() , and I get a list of attributes, but no filenames - and I don't see anything that guarantees that those two lists will be in the same order, so as far as I know, I

PowerShell script to copy files but not subfolders to SFTP and move to subfolder once done

筅森魡賤 提交于 2021-02-08 02:12:25
问题 I am using the following script to copy files from my local folder to SFTP. Once I upload the file I then want to move the file to a subfolder. I want to upload only files in the C:\Users\Administrator\Desktop\ftp folder, and not files in the other subfolders. param ( $backupPath = "C:\Users\Administrator\Desktop\ftp\moved" ) # Load the Assembly and setup the session properties try { # Load WinSCP .NET assembly Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll" $session = New-Object