Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » [Solved] SFTPBrowser example build failed (SFTPBrowser example buil error: error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function winstore_close)
Re: SFTPBrowser example build failed [message #61273 is a reply to message #61272] Wed, 18 December 2024 15:20 Go to previous messageGo to previous message
Scott_Huang is currently offline  Scott_Huang
Messages: 27
Registered: December 2024
Promising Member
@Oblivion, thanks for your prompt answer!

I try test the demo SFTP server which you provided, it seems work well.

However, when I switch to my SFTP server, it have the same error which I describe in last post.
I am sure my SFTP user name & password is correct and have write access right.

I guess may be dir/path error, you also mention it, so I adjust connect() function to manual set basedir as below.
session.Timeout(settings.timeout * 1000);
	if((connected = session.Connect(
		~settings.host,
		~settings.port,
		~settings.user,
		~settings.password
		))) {
		browser.Attach(new SFtp(session));
		filesystem.Mount(*browser);
		basedir = browser->GetDefaultDir();
		basedir = "msp";//add for testing
		DLOG(basedir);
		dir.SetData("msp");//add for testing
		DLOG(dir.GetData().ToString());
		DLOG(GetWorkdir());
		DLOG("Before work dir");
		Workdir(basedir);
		DLOG("After work dir, and before LoadDir");
		LoadDir();
		DLOG("After load dir");
	}
	else SessionError();
}


The list still empty, but I am able upload file or create sub folder without error. And other SFTP software does show the file & folder created too.

So, that means, loaddir() function have issue.
Not able successful list folder & files.
After add more DLOG, I am sure it caused by below:
if(Upp::Load(list, GetWorkdir(), "*", false, Null, (FileSystemInfo&) sfsi, Null, false))
sortbyext ? SortByExt(list) : SortByName(list);




LOG:

SSH: Session, oid: 1: Using Upp's memory managers.
SSH: Session, oid: 1: Session successfully initialized.
SSH: Session, oid: 1: Compression is disabled.
SSH: Session, oid: 1: Handshake successful.
SSH: Session, oid: 1: Authentication methods list successfully retrieved: [publickey,password,keyboard-interactive]
SSH: Session, oid: 1: Client succesfully authenticated.
SSH: SFtp, oid: 2: Session successfully initialized.
SSH: SFtp, oid: 2: Symbolic link operation is successful. Target: /
SSH: SFtp, oid: 2: Failed. Code = -31, SFTP Protocol Error
SSH: SFtp, oid: 2: Failed. Code = -31, Failed opening remote file
SSH: SFtp, oid: 3: Session successfully initialized.
SSH: SFtp, oid: 3: File 'msp/test.txt' is successfully opened.

SSH: SFtp, oid: 3: File attributes successfully retrieved.
SSH: SFtp, oid: 3: File handle freed.
SSH: SFtp, oid: 3: Session deinitalized.
SSH: SFtp, oid: 2: Failed. Code = -31, SFTP Protocol Error ==> Scott, It caused by I try create one existing temp folder.
SSH: SFtp, oid: 2: Directory 'msp/temp2' is succesfully created.
SSH: SFtp, oid: 2: Failed. Code = -31, SFTP Protocol Error ==> Scott: Should be loaddir() function caused error.
SSH: SFtp, oid: 2: Failed. Code = -31, Failed opening remote file

I try add more DLOG:
void SFtpBrowser::LoadDir()
{
	if(browser->InProgress())
		return;
	list.Clear();
	DLOG("Before SFtpFileSystemInfo sfsi(*browser);");
	SFtpFileSystemInfo sfsi(*browser);
	DLOG("After SFtpFileSystemInfo sfsi(*browser);");
	DLOG("Before If");
	DLOG(GetWorkdir());
	if(Upp::Load(list, GetWorkdir(), "*", false, Null, (FileSystemInfo&) sfsi, Null, false)){
		DLOG("Before sort");
		sortbyext ? SortByExt(list) : SortByName(list);
		DLOG("After sort");
		}
	DLOG("After If");
	DLOG("Before Summary()");
	Summary();
	DLOG("After Summary(), and before Sync()");
	Sync();
	DLOG("After Sync()");
}

LOG Details:
SSH: Session, oid: 1: Using Upp's memory managers.
SSH: Session, oid: 1: Session successfully initialized.
SSH: Session, oid: 1: Compression is disabled.
SSH: Session, oid: 1: Handshake successful.
SSH: Session, oid: 1: Authentication methods list successfully retrieved: [publickey,password,keyboard-interactive]
SSH: Session, oid: 1: Client succesfully authenticated.
SSH: SFtp, oid: 2: Session successfully initialized.
SSH: SFtp, oid: 2: Symbolic link operation is successful. Target: / ==> Scott: Is it the root cause? I try set to known folder "MSP" instead of "/"
msp
msp
msp
Before work dir
After work dir, and before LoadDir
Before SFtpFileSystemInfo sfsi(*browser);
After SFtpFileSystemInfo sfsi(*browser);
Before If
msp ==> Scott: I try DLOG(GetWorkdir());
SSH: SFtp, oid: 2: Failed. Code = -31, SFTP Protocol Error
SSH: SFtp, oid: 2: Failed. Code = -31, Failed opening remote file

After If
Before Summary()
After Summary(), and before Sync()
After Sync()
After load dir



Any way to fix it?

[Updated on: Wed, 18 December 2024 15:59]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Latest U++ PDF version user guide to describe framework/tips/examples
Next Topic: The UPP looks good -> Opportunities to evolve to better support RPA & AI
Goto Forum:
  


Current Time: Tue Aug 05 14:39:49 CEST 2025

Total time taken to generate the page: 0.03405 seconds