PutFile not finding local file (wodSFTP / wodSFTP.NET / wodSFTPdll)
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
Nate,
perhaps you don't have permissions to access that file? Remember, ASP is running as guest user.
Re: PutFile not finding local file
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
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
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
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 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
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
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