FTP

149

Solutions

291

Contributors

The File Transfer Program (FTP) is a standard network protocol used to transfer computer files between a client and server on a computer network. Built on a client-server model architecture, it separates control and data connections between the client and the server. Users may access the server through a sign-in protocol, typically in the form of a username and password.

Share tech news, updates, or what's on your mind.

Sign up to Post

i am new to the powershell scripting and at learnig stage.
i have scripts it works (experts helped me move on further)....it checks for file, upload the file in ftp.
i have written function to send email when process complete and also capture the errors and send email error alert.
i noticed the status email works with sending attacment and failure email alerts just capturing ERROR word but not sending email alert...
Like to request for help..
I want email alerts to come body message to have errors captured ? or if possible the log file context to write in the email body.
Also like to check what more parameters to set so that we get errors alerts in the log...for timeout ,username password wrong etc...Modify_Script.ps1Modify_Script.ps1



#Requires -version 3.0
$WarningPreference="Continue"

#variables
$ScriptPath = $(Split-Path -Parent $MyInvocation.MyCommand.Definition)

# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom( $(Join-Path $ScriptPath "WinSCPnet.dll") ) | Out-Null

#Log Timestamp
$date=Get-Date -Format ddMMMyyyyHHmmss
$logdate=Get-Date -Format ddMMMyyyy_HHmmss
$emaildate=Get-Date -Format dd/MM/yyyy_HH:mm:ss
$Logfile = "E:\INT\Log\Daily_$logdate.txt"

function LogWrite ([string]$logstring)
{  
   Add-content $Logfile -value $logstring
}
LogWrite ("$( Get-Date -Format "yyyy-MM-dd HH:mm:ss" ) START:`t"+"File Processing BEGIN`n")

#Zip Files and move to backup folder
$sourcefolder="E:\INT\PUT"
0
Identify and Prevent Potential Cyber-threats
Identify and Prevent Potential Cyber-threats

Become the white hat who helps safeguard our interconnected world. Transform your career future by earning your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

Hello Experts-I'm running with an issue. I have created a FTP file server on my local system on WIN10. I've a static IP address & am able to access & see the files from any outside IP through a web browser. But when I try accessing the FTP folder from an outside IP/network through file explorer, I get an error message as stated below.-

The folder 'ftp://49.206.199.25/' is read-only because the proxy server is not set up to allow full access. To move, paste, rename, or delete files, you must use a different proxy. For information on changing your proxy, contact your administrator.'

I read several online posts & found the solutions but they never worked for me. I disabled the windows firewall but still I'm seeing the same issue, I did the setting in "internet options-FTP folder view" but this also did not help.

Can anyone help please.
0
I've set up FTP on Server 2012 Standard, I'm accessing with a local user account and can log in fine but cannot see any of the files. Local user used has full permissions on the FTP folder, has to be something simple I'm not thinking of.

Connecting from Mac to local IP (opens an Empty folder)

Connecting locally from explorer (200 type set to A / 227 Entering Passive Mode ("public IP",232,79)
0
We're having issues with ftp.exe on Windows 2016 servers located in Azure. Connecting to a FTP server using for instance explorer or ncftp works fine but when we do it using ftp.exe we can connect and then get instantly disconnected when for instance sending the ls command. We've tested on Windows 2016 servers not located in Azure and then everything works fine. We are not blocking any outbound connections from the VM to the internet.

Has anyone seen this issue before and can help us resolve it?
0
Hi Experts

I setup a basic ftp server on Windows 2016 server.  I can use ftp clients to download files from the server.  But I can't download any when I use any of browsers.  I can browse the ftp folder and  there is no download option to choose.

Please advise and thank you very much in advance,

EN
0
I had this question after viewing How to connect to multiple parallel SFTP using JSCH?.

Is it possible to have multiple SFTP connections for the same host,username and port??
0
I need to be able to host files(images in this case) on a server, to be read by my ecommerce website.

I would like to be able to control the names of the files and folders.  For instance, I might want to call the image http://www.hostingsite.com/project1/images/book_cover.jpg

An added bonus would be if I could map a local drive letter, like "X:\" to my hosted folder.  I usually use a combination of FTP and Webdrive to achieve this.
0
I have one access_log under main folder and have to copy that access_log under another folder where external FTP Server can able to download the log automatically.

My Question is Access_log generated in server for Whole day but we need to have only access_log for 15minutes using diff command.

Please let me know the diff command to be used for changing filename automatically everytime once the diff checked between two files.
0
Hi,
So I am in the middle of changing a scheduled tasks account that it runs under as the current ones password is changed monthly.
I have added the account to the same groups for permissions as the previous account.

The basics of the script are:
Connect to FTP
Download files
Rename files
Move files
Archive files

Now when i run a test on the script it is for some reason it was unable to see the txt file that connects to the FTP account, i have to edit the command to point the script to the full path location "C:\tempfiles\ftpscript.txt" instead of it previously using "\ftpscript.txt", then it is also downloading the files into my documents and not the directory that it was downloading to before "C:\tempfiles"

It is as if the cmd prompt looks to different locations when run under those different accounts? I am not sure why it is now downloading in that location when it ran fine before. I think the only difference between the 2 accounts are that the previous account was the built in domain admin account and this is a new account we created which is also a domain admin account.

Script below:

:: Download all files via WINSCP
"C:\Program Files (x86)\WinSCP\winscp.com" /script=ftpscript.txt

:: Rename files
cd: "c:\tempfiles"
ren p3de* "temp file1"
ren p3tr* "temp file2"

:: Move files
COPY C:\tempfiles\* \\REMOTESHARE\SHARE\SHARE\*

::Archive files
MOVE "C:\Tempfiles\*.* "C:\tempfiles\archive"

Now so far i have amended the download command to …
0
Has anyone got any recommendations for an FTP client which supports TLS/SSL (not SFTP,) can be automated and can notify via email the log from a download?
0
10 Tips to Protect Your Business from Ransomware
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

We have a script that is executing sftp file transfers to a directory on the server, which is running Red Hat Linux.  Is there a way to configure the destination directory so that any file placed there via SFTP will inherit RW-RW-RW permissions?

Thanks in advance for any hints or advice.

-Dan
0
I have three locations that I custom develop for, and each location has the exact same code on each page.  However, each page has site dependent code (if url = 123 then this code, else this code, etc).  this allows me to have one master copy of each page and then distribute that one page to all 3 locations.

so, right now, I just do a copy paste of file a to location a, location b, and location c, all on different servers, all in different physical locations (but with a tunnel built between all 3 locations).

I'd like to have a drag and drop, or double click, something that makes my file I modified "live" without having to copy the file to 3 locations.  My initial thought was some sort of ftp where I double click the file and it makes the file live to all 3 locations, but I'm not certain that is possible.

Any suggestions?
0
Hello,
    I am using the AWS sFTPGateway application made by Thorn Technologies. It lets you connect an EC2 instance to an S3 bucket and then allow sFTP from the outside which then gets stored into the bucket in a folder based on the linux user that you create. When you create a user it puts them in to the sftponly group and they are locked to their home directory, which ends up being /home/user/home/user/*files_go_here. I asked them about using standard FTP and they said while it is not officially supported people have had success by using information found here https://stackoverflow.com/questions/7052875/setting-up-ftp-on-amazon-cloud-server#.

    I went through the steps to install and setup vsftpd, I can hit a login using standard port 21 ftp but it does not seem to authenticate properly and I am not seeing anything in the logs anywhere regarding this. Most of the setup seems the same as the sftpgateway such as having a user created, them being in the sftponly group, etc. The user can be logged in when using port 22, but not port 21. Does anyone have any insight as to what I might need to change to allow this to work? I am not sure if there is something within vsftpd that  I need to change so that it knows each user is now in /home/user/home/user instead of just /home/user, as permissions for that particular user are only on the last /user folder and not on anything before that.

If anyone has any information, I would greatly appreciate  it!

Thanks,
0
When I amend or edit one of our sites pages via ftp, the Javascript on the entire site breaks. I believe this is because strange characters appear in the JS core file of JQuery.js despite this starting as a working file.

If a external freelance developer uploads to the site it works fine.

Already tested different ftp software and bypassing the server when uploading.

This happens on multiple sites. Can any provide any solutions to what might be causing this?

strange code in JQuery.js as below and in attachment.enter image description here

(" "+c.className+" ").replace(ac," "):" ")){f=0;whi¿‹8¿‹8Ä⁄7Pÿ7(›8‡‹8ûF‡‹8,removeClass:
0
When running this script,  I am prompted to hit enter to continue.
I want to eliminate that prompt.

@echo off
set local

set /p password=<%~nx0:password
if not "%password%"=="" goto OK
set /p password=Enter password:
echo %password%>%~nx0:password
:OK

set localdir=\\srv\folder1\folder2\folder2
set remotedir=/out
set ftpserver=info1.info.com
set username=123456

:del "%localdir%\*.*" /q

call :GetFtpFiles
call :ClearFTPFiles

exit /b

:GetFTPFiles
    (echo open %ftpserver%
    echo user %username% %password%
    echo bin
    echo cd %remotedir%
    echo lcd "%localdir%"
    echo mget *.*
    echo quit
    ) | ftp -n -i
    exit /b

:ClearfTPFiles
    (echo open %ftpserver%
    echo user %username% %password%
    echo cd %remotedir%
    (for /f "tokens=*" %%a in ('dir /b /a-d "%localdir%\*.*"') do @echo dele "%%~a")
    echo quit
    ) | ftp -n -i -d



pushd "\\1srv\\folder5\folder6"
if exist *.csv copy /b *.csv "\\2srv\folder7\folder8"
popd

pushd "\\srv\folder1\folder2\folder2"
if exist *.csv ping -n 5 -w 1000 127.0.0.1 > nul
popd



cd..
cd..
cd..
cd..
cd..
set PSFile=%~dp0Otherscript.ps1
PowerShell.exe -ExecutionPolicy Bypass -Command "& '%PSFile%'"

popd


exit
0
Hi,

We have a requirement to make a consolidate log from 2 different servers Solaris servers. 1 should have the customer Id, customer name details and all and 2 server should having the transaction ID and verification details. How should I make a consolidated log from these 2 servers. any ideas?
0
How can I use python in order to get the  router running-config file through ftp protocol?
I now that in the router you only need to use this command copy running-config ftp, but I want to get the file from the host.
0
Hi All,
          I am new to sftpg3. I would like to know about the setup of sftpg3 interrupt time at every 5 minutes. Is it doing at the client side or Server side? Please help me. It's urgent Thank you.

best,
Myo
0
I currently have a C# WCF Service hosted in IIS 8.5  which allows users to print labels. Because the label printers are local printers for each user (USB connection on their laptops) they are forced to open the label in their browser and then click print on each label to print to local label printer. What the users want is for the labels to print automatically without any user intervention but without the printers being networked this does not seem possible - or is it?

Is it possible to use FTP to drop the text files (labels) directly onto the label printer spool queue of the laptop requesting the label?  The Service will have the IP address of each logged in user  but how can I send a file to a spooler rather than a folder and if it can be done can it be done silently ,without any user interaction.

I notice that when I send a label manually to the USB printer on the laptop (Windows 7 64bit) there are two files populated into c:/windows/system32/spool/PRINTERS. a SHD file type and a SPL file type. Is there any way of generating these two file for  the label text file to be printed?
 
I assume that a common FTP Site would need to be configured on each laptop for this to work. Appreciate any guidance and/or examples I can get.

regards
Pat
0
Choose an Exciting Career in Cybersecurity
Choose an Exciting Career in Cybersecurity

Help prevent cyber-threats and provide solutions to safeguard our global digital economy. Earn your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

Here's my environment:

Windows 2012 R2 NAT'd to public via FortiGate firewall.  Running IIS7 only for FTP.
I have one client who sends files in a batch once or twice a day.  the client supplied the SSL certificate for FTPS connection and all works well, mostly.
At some point in the transmission, FTP will stop transferring files and the Windows will log System Event 36888 from Schannel.  The TLS protocol error code is 20 and the SChannel error state is 960.

Research didn't track down an exact solution, but some folks were correcting the same error codes by replacing or 'fixing' the certificate.  I had our client generate a new certificate and installed it, but the errors/disconnects continue to occur.  

File sizes are 114KB and 36KB (they come in pairs).  Today, after replacing the cert, the client sent 240 pairs - 480 individual files - and there were five SChannel reset errors logged.  Each time that happens, the client has to restart the sending process.

the OS is fully updated.

Earlier in troubleshooting, I suspected the firewall - outdated OS/old hardware - and configured the path through our new FortiGate firewall (noted above)

I would much appreciate any input you have on how to troubleshoot further or what may be the cause

Thanks!

= k =
0
I have a list of files to be FTPed from one server to another.  This process had been working.  Recently, only part of each file was successfully sent.  The files are all 20-30kb.  When sent to the 2nd server, only 3-6kb of each file shows up.

The script loops through the list of files and uses this code to FTP them:
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
set objshell = nothing

Open in new window


I tried to slow the process down by adding a msgbox and it worked:
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
set objshell = nothing
msgbox "Press ENTER to continue"

Open in new window


Next, I tried the sleep command to delay it by 20seconds. It did not work. Only parts of the files were transfered.
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
wscript.sleep 20000
set objshell = nothing

Open in new window

0
public void PostImagesToServer(Stream Images)
        {
         
            try
            {
                Guid Unique = System.Guid.NewGuid();
                string U = Unique.ToString();
                string Name = U + ".jpg";
                FtpWebRequest req = (FtpWebRequest)WebRequest.Create("ftp://NikhelPrans117@182.50.151.43/webservice/ChachaChaudaryImages/ComicImages/" + Name);
                req.Credentials = new NetworkCredential("NikhelPrans117", "Nilesh@2188");
                req.KeepAlive = true;
                req.UseBinary = true;
                req.Method = WebRequestMethods.Ftp.UploadFile;
                byte[] fileData = StreamToByte(Images);
                req.ContentLength = fileData.Length;
                Stream reqStream = req.GetRequestStream();
               
                reqStream.Write(fileData, 0, fileData.Length);
               
                reqStream.Close();
}
0
Hi, currently I have a FTP script will upload the file ${file}.$$.log to the FTP server, it's working fine but I need to add the function to able handle error, FTP server is not allow user to list and write, can you provide the additional script to check

1. Verify the file is successful upload to the FTP server
2. if upload is fail write the date time and fail upload file name to a file then move the file to the /tmp

#ftp -inv $HOST << EOF
ftp -n $HOST <<END_SCRIPT

#user $USER $PASS
quote USER $USER
quote PASS $PASS

lcd /tmp

put ${file}.$$.log


# End FTP Connection
#bye
quit
END_SCRIPT
exit 0

Open in new window

0
I have a corrupt powerpoint file. I believe the reason its corrupt is because when it was downloaded using FTP, it was downloaded using the default ascii mode. I dont have the original file, so I could ftp again using binary mode. Can my existing "corrupt" powerpoint file be converted from ascii to binary? If so, how do I do it?
0
Is FILEZILLA 3.18.0 HIPAA compliant?
0

FTP

149

Solutions

291

Contributors

The File Transfer Program (FTP) is a standard network protocol used to transfer computer files between a client and server on a computer network. Built on a client-server model architecture, it separates control and data connections between the client and the server. Users may access the server through a sign-in protocol, typically in the form of a username and password.