I have a folder (essa é nova pasta
) with multiple .txt files in it
C:\xml\UPLOAD\essa é nova pasta\35160101660296000130550020000540011858610314.txt
The folder is a name that has accent (essa é a nova pasta
) and made a script to generate a list of all the .txt files, but looked like this:
C:\xml\UPLOAD\essa ‚ nova pasta\35160101660296000130550020000540011858610314.txt.
I need to create an FTP script to make a put to from the list of .txt files. generated above. I used the FOR command and begot the list but it came out like this:
user
password
put "C:\xml\UPLOAD\essa ‚ nova pasta\35160101660296000130550020000540011858610314.txt" /content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
He gave a message that the file does not exist, because it does not recognize the name of the folder (essa ‚ nova pasta
)
I need my FTP script exit as the folder name "this is new folder", ie, with the correct name and manages my FTP script correctly as follows:
user
password
put "C:\xml\UPLOAD\essa é nova pasta\ 35160101660296000130550020000540011858610314.txt" /content/UPLOAD/35160101660296000130550020000540011858610314.txt
bye
How do I solve this problem?
If all your files come from "C:\xml\UPLOAD\essa é nova pasta\" then you can (once, at the top) run
That way you're not manipulating the accented character in a
for
loop.Then your put statements will look like this:
If all your files need to end up in the remote directory
/content/UPLOAD/
then you can further simplify by changing to that directory in the ftp command like this:Then your put statement looks like this:
You don't need to specify the filename twice that way. So to transfer these files:
to the remote server's directory
/content/UPLOAD
: