Topic "Error occurred while setting the permissions and/or timestam"

Author Message
dasschwein
[View user's profile]

Joined: 2013-09-17
Posts: 2
So I got the infamous error: "Upload of File 'filename' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn on 'Ignore permissions errors' option."

I'm using Visual Studio Express 2012 to compile a Visual Basic Windows Forms Application, using Using the WinSCP 5.2.4 beta portable executable and .NET assembly / COM library.

I've added the following:
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
transferOptions.PreserveTimestamp = False
transferOptions.FilePermissions = null

The third line produces the following error: 'null' is not declared. 'Null' constant is no longer supported; use 'System.DBNull' instead

Recommendation: Replace 'Null' with 'DBNull.Value'.

When I make this recommended change, I get the following error: "Value of type 'System.DBNull' cannot be converted to 'WinSCP.FilePermissions'.

I tried various options, like vbNull, vbNullString, vbNullChar, "", and 0 - none of which can be converted to 'WinSCP.FilePermissions'.

-----------------------------------------------------------------------------------------------------
I am able to use the GUI version, and successfully upload with the following settings:

"Set permissions" was already unchecked
Unchecked "Preserve timestamp"
Set "Enable transfer resume/transfer to temporary filename for" to Disable

I've also tried
session.DefaultConfiguration = False and session.IniFilePath with a working .ini file, and still get the same error in Visual Studio.

Does anyone know how to set a null value for transferOptions.FilePermissions in vb.net (that won't produce an error), or know of anything else I can try to get it working with the .ini file?

Thanks!

I've already reviewed: https://winscp.net/eng/docs/faq_not_owner and https://winscp.net/eng/docs/message_preserve_time_perm - and neither has helped unfortunately.
dasschwein
[View user's profile]

Joined: 2013-09-17
Posts: 2
Setting transferOptions.FilePermissions to "Nothing" instead of "null" seems to work in vb.net:

Code:
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
transferOptions.FilePermissions = Nothing
transferOptions.PreserveTimestamp = False
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
I do not know VB.NET, but isn't it Nothing, not Null?
See http://stackoverflow.com/questions/2390348/how-to-assign-null-values-in-mysql-using-vb-net
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