PutFile not finding local file - WeOnlyDo Discussion board

PutFile not finding local file (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Nate, Wednesday, November 02, 2005, 22:47 (6755 days ago)

Hi

I am haveing trouble with the PutFile command with an ASP page. This is the code:

set objConn=server.CreateObject( WeOnlyDo.wodFtpDLXCom.1 )
set Session( object )=objConn

objConn.Hostname = ...
objConn.Login = ...
objConn.Password = ***
objConn.Protocol = 0

objConn.Blocking = 1
objConn.Connect

objConn.PutFile c:MI203.TIF , /MI203.TIF

The c:MI203.TIF is on the local hard drive but I get an error

WeOnlyDo.wodFtpDLXCom.1 error '800a7545'

LocalPath should specify a file, and such file does not exist.

Thanks.

Re: PutFile not finding local file

by wodSupport, Wednesday, November 02, 2005, 22:55 (6755 days ago) @ Nate

Nate,

perhaps you don't have permissions to access that file? Remember, ASP is running as guest user.

Re: PutFile not finding local file

by bugmenot, Thursday, March 13, 2008, 21:09 (5893 days ago) @ wodSupport

perhaps you don't have permissions to access that file? Remember, ASP is running as guest user.

What permissions are necessary? I am unable to use putfile on a file that I wrote (and can read) via the Scripting.FileSystemObject, so it's not an ASP/user access issue.

Re: PutFile not finding local file

by wodDamir, Thursday, March 13, 2008, 21:23 (5893 days ago) @ bugmenot

Hi Nate,

Can you perhaps try (just for test) running ASP as an Administrator?

You can do that by following these steps:

Go to Start->Settings->Control Panel->Administrative Tools->Internet Services Manager. Here you will find 'Default Web Site', right-click on it, select 'Properties'. Go to the 'Directory Security' tab, at the top is the 'Anonymous access and authentication control' frame, and an 'Edit' button. Click on 'Edit' button. The 'Authentication Methods' dialog box appears, click the 'Edit' button to see the 'Account used for anonymous access' dialog.

Here you should enter Username: 'Administrator' and for Password: enter the administrator account password. Click on 'Ok' to close all windows and wodFtpDLX should now run.

If that works, then we can rule out the possibility that this is permissions issue.

Regards,
Damba

Re: PutFile not finding local file

by bugmenot, Thursday, March 13, 2008, 21:43 (5893 days ago) @ wodDamir

Can you perhaps try (just for test) running ASP as an Administrator?

No, I can't. Unfortunately, the only way I have access to this specific application and component is on the production server and I can not make such a drastic security change. I have, however, given Full Control access (to the folder [and its contents] that contains the files I am trying to upload) to both the Users group and the specific iusr_* account in use by the domain.

Re: PutFile not finding local file

by wodDamir, Thursday, March 13, 2008, 22:33 (5893 days ago) @ bugmenot

Hi,

I've just tried this locally, and it works as expected. I was able to use PutFile to upload a file without issues.

Can you try putting the file to the same directory as your asp document? Do you still receive that error?

Another thing you can try is setting LocalPath property before calling PutFile method. Does that help?

Regards,
Damba

Re: PutFile not finding local file

by bugmenot, Friday, March 14, 2008, 21:19 (5892 days ago) @ wodDamir

By the way, this forum sucks; I lost my entire post three times because of various login-related issues.

A-ha. Following your suggesting, I think I've figured it out. Here's what I saw:

When I set LocalPath (but only if I specified the full path to the file, and whether or not I specified the file again via putFile) I got a different error: 800a7542, Server returned an error: Permission denied.

I knew I was successfully connected because I could get a directory listing. I then realized that the remote site, when connected to via a GUI client, throws my user into a specific subdirectory. Specifying that in the putFile command (e.g. putFile sFile, /directoryName/ ) seems to have done the trick. The confusing thing was that the first error of LocalPath should specify a file, and such file does not exist. implies a local issue, but it turns out to be more related to remote permissions.

Also, I MUST do:

sftp.LocalPath sFile
sftp.putFile sFile, /directoryName/

because if I omit the first line, I get the local file not found error. Odd, that.

Anyway, thanks for your help.

Re: PutFile not finding local file

by doteffect, Thursday, March 20, 2008, 23:17 (5886 days ago) @ bugmenot

i am having the same problem that return error below;

LocalPath should specify a file, and such file does not exist.

I tried the suggestion below but failed.

sftp.LocalPath sFile
sftp.putFile sFile, /directoryName/

On further test, i found that when the script executed, it actual look for file on server instead of user pc.

Did you guys tested with a separate pc and upload a file to server? or just test upload file within the server?

Anyone can help? Please. Thanks.

Re: PutFile not finding local file

by woddrazen, Thursday, March 20, 2008, 23:56 (5886 days ago) @ doteffect

Hi,


Yes, ASP server and SFTP server is communicating. Unfortunately you can't upload file directly to SFTP server. You can try using PutFile Method instead. PutData Method stores data from string variable to remote file.

Why don't you try ASP sample that comes with wodFtpDLX installation. You can find it in component Samples folder (Samples\ASP\fetch.asp).

If you are uploading larger file, you should extend ASP server timeout.

Here is example:[code]
<
Server.ScriptTimeout = 1800
>
[/code]
Hope this helps.


Regards,
Drazen