I can't write files to the specified folders via ftp

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

I can't write files to the specified folders via ftp

#1 Post by Eugene Lutsenko »

I can't write files to the specified folders via ftp. And sometimes it works, and sometimes it doesn't. I tried to do it in different ways. And first make the folder current, and then write the file. And immediately record the full path. It used to work, but now it doesn't work. At the same time, what I did before works well.

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: I can't write files to the specified folders via ftp

#2 Post by Tom »

You always get a response from a FTP server. Look at this. It will tell you why it works sometimes and sometimes not.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: I can't write files to the specified folders via ftp

#3 Post by Eugene Lutsenko »

Tom wrote: Thu Apr 14, 2022 6:31 am You always get a response from a FTP server. Look at this. It will tell you why it works sometimes and sometimes not.
I always check everything: whether it was possible to create a connection, whether it was possible to make a given folder current, whether it was possible to upload or download a file, etc. I check everything absolutely, and if something is wrong, I always give the appropriate reasonable messages. But often the server only gives out .T. or .F.. where can I get more detailed information?

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: I can't write files to the specified folders via ftp

#4 Post by Wolfgang Ciriack »

Have you set oFTP:PassiveMode := .T. ?
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: I can't write files to the specified folders via ftp

#5 Post by Eugene Lutsenko »

Wolfgang Ciriack wrote: Thu Apr 14, 2022 10:13 pm Have you set oFTP:PassiveMode := .T. ?
No, he didn't. And where and how to do it?

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: I can't write files to the specified folders via ftp

#6 Post by Wolfgang Ciriack »

I use the ftp client from Xb2.Net. If you use the XBase++ ftp client look at the FtpClient:connect() description:
:connect(FTP_CONNECT_PASSIVE_MODE)
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: I can't write files to the specified folders via ftp

#7 Post by Eugene Lutsenko »

hi, Wolfgang Ciriack!
I use the xBase++ ftp client. Thanks, I'll try it now.
:
Attachments
Безымянный.jpg
Безымянный.jpg (89.03 KiB) Viewed 3991 times

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: I can't write files to the specified folders via ftp

#8 Post by Wolfgang Ciriack »

you must include "asinet.ch".
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: I can't write files to the specified folders via ftp

#9 Post by Eugene Lutsenko »

hi, Wolfgang!
Here is a fragment of the program. It works, but incorrectly. Function: oFtp:Directory() does not see the folder: "htdocs". The function: oFtp:CurDir("\htdocs\messages") cannot make the current folder: "\htdocs\messages" and returns a space.

Code: Select all

oFtp := FTPClient():new( cFtpServer, cUserName, cPassword ) // Соединение с моим сайтом и авторизация
 
 IF .NOT. oFtp:connect(FTP_CONNECT_PASSIVE_MODE)             // Есть соединение с моим сайтом и авторизация?
    DC_Impl(oScrn)
    LB_Warning('Нет соединения с FTP-сервером', '(С°) "Crypton"')
    cOutString = 'Нет соединения с FTP-сервером'
 ELSE

    wtf oFtp:curDir()
    wtf oFtp:Directory()                          // VALUE: {{"Downloads.exe", 10242016, 20201202, "07:57:00", "N", 0,         , "00:00:00",         , "00:00:00"}}
    wtf oFtp:curDir("\htdocs\messages")
    wtf oFtp:Directory()                          // VALUE: {{"Downloads.exe", 10242016, 20201202, "07:57:00", "N", 0,         , "00:00:00",         , "00:00:00"}}
Attachments
Безымянный3.jpg
Безымянный3.jpg (68.83 KiB) Viewed 3975 times
Безымянный2.jpg
Безымянный2.jpg (45.79 KiB) Viewed 3976 times
Безымянный.jpg
Безымянный.jpg (135.98 KiB) Viewed 3976 times

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: I can't write files to the specified folders via ftp

#10 Post by Wolfgang Ciriack »

Try oFtp:curDir("htdocs") (without the backslash at the beginning).
Then aF := oFtp:Directory(). What is the content of aF ?
_______________________
Best Regards
Wolfgang

Post Reply