login about faq

I think I found a false positive bug in ckFielAccess for ActiveX.

When the IIS user does not have access to a shared folder on another machine the result of .FileExists(x) is always 1.

-Erik

Code:

Set oFA = Server.CreateObject("Chilkat_9_5_0.FileAccess")

If oFA.FileExists(c("folder_path") & inFileName) = 1 Then
  FullPath = c("folder_path") & inFileName
ElseIf oFA.FileExists(c("folder_path_old") & inFileName) = 1 Then
  FullPath = c("folder_path_old") & inFileName
End If

Response.Write oFA.LastErrorHTML
ChilkatLog:

FileExists:
    DllDate: Aug 1 2014
    ChilkatVersion: 9.5.0.43
    UnlockPrefix: NONE
    Username: BUTCHER:IUSR_BUTCHER
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 1
    filename: \\mathis\shared\ecertsfiles\accounting\xml\abc.pdf

When I switch the IIS user an account that does have access to shared resource I get the expected result.

ChilkatLog:

FileExists:

    DllDate: Aug 1 2014
    ChilkatVersion: 9.5.0.43
    UnlockPrefix: NONE
    Username: BUTCHER:internetuser
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 1
    filename: \\mathis\shared\ecertsfiles\accounting\xml\abc.pdf
    WindowsError: The system cannot find the file specified.

asked Oct 09 '14 at 20:42

emartinson's gravatar image

emartinson
148162030


The problem is that FileExists returns true/false, but there is a 3rd possibility -- that it is impossible to even check to see if the file exists. That's what is happening here. I'm going to add a new method named "FileExists3" which returns an integer value:

-1: Unable to check because of permissions or some other error.
0: Does not exist for sure.
1: Exists for sure.

link

answered Oct 10 '14 at 11:05

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for the supper fast response. I understand what you are saying, but I think your original logic it still correct with the exception of the false positive. I think the call should return false if the file is not there or the location is not accessible. If the geterrortext would return the permission denied information or any other file system error, that would be ideal to me.

(Oct 10 '14 at 13:16) emartinson
link

answered Oct 10 '14 at 11:46

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×96
×6

Asked: Oct 09 '14 at 20:42

Seen: 1,029 times

Last updated: Oct 10 '14 at 13:16

powered by OSQA