Topic "Absolute File Path Usage"

Author Message
Zild
[View user's profile]

Joined: 2013-11-12
Posts: 4
Hi all,

I started trying to use the .NET assembly today (V5.1.7.0) for FTP protocol but am having difficulty with file paths on the target server.

The problem is any connection to the server (using either the WinSCP exe or the .NET assembly within my own software) seems to be routed instantly to a subdirectory (e.g. home/zild), but the files need to be uploaded to a different directory (e.g. home/test). If I try to set the remote path to home/test/ (the absolute path) it actually uses a relative path (e.g. home/zild/home/test). I thought the .NET assembly only used absolute paths, so this is a surprise. Unfortunately I cannot find a way to set the path to the desired location (home/test).

Can somebody please explain what I am doing wrong here? I have tried searching the documentation and forums already but remain stuck.
Advertisements
iceporing
[View user's profile]

Joined: 2013-10-29
Posts: 4
Quote:

If I try to set the remote path to home/test/ (the absolute path) it actually uses a relative path (e.g. home/zild/home/test).


Try using /home/test/
Zild
[View user's profile]

Joined: 2013-11-12
Posts: 4
Thanks for the suggestion, but it gives the same result; it creates "/home/zild/home/test" then uploads to there. Sad

EDIT: Sorry, my mistake. It turns out the user account my software is using has limited permissions on the target server, preventing it from creating files in the required directory. When trying to create files within an accessible directory everything works as expected. Embarassed

EDIT2: Correction, no it does not. I can still only create files in "/home/zild" and its subdirectories, not "/home/test" (for which I now supposedly have permissions for). Either with or without the leading "/", the resulting directory location is the same.

Any suggestions at all?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Your post on StackOverflow:
http://stackoverflow.com/questions/19969033/winscp-net-assembly-cannot-use-absolute-file-path
Zild
[View user's profile]

Joined: 2013-11-12
Posts: 4
Thank you. Obviously if I find an answer there I will post it back here. Nothing yet though.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
On SO, I've asked you to share your code.
Can you please do this (here or there) and even better also attach a log file?
_________________
Martin Prikryl
Zild
[View user's profile]

Joined: 2013-11-12
Posts: 4
Thanks. I updated my post on SO to include my code. Will add logs if I get them working (not played with them yet, don't even know where to start!)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Zild wrote:
Thanks. I updated my post on SO to include my code. Will add logs if I get them working (not played with them yet, don't even know where to start!)

I've answered on SO.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License