Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ITC PUT problems

Status
Not open for further replies.

sborny

Technical User
Jun 29, 2001
157
GB
Hi,

I am using the Internet Transfer Control to download a file from a website.

The download works fine but I also need to delete the file on the website and upload a new file.

The app seems to get stuck on the delete command.

This is the code i am using.

Code:
Sub fuload()
Bimp.Inet2.Protocol = icFTP
    Bimp.Inet2.URL = "80.88.192.200"
    Bimp.Inet2.UserName = "eu7hnbg554fr"
    Bimp.Inet2.Password = "db911709sn"
    Bimp.Inet2.Execute , "DELETE csv/app.csv"
    
    Do While Not inetReady
        DoEvents
    Loop
    Bimp.Inet2.Execute , "PUT" + App.Path + "\app.csv csv/app.csv "
    Do While Not inetReady
        DoEvents
    Loop
    Bimp.Inet2.Execute , "CLOSE" ' Close the connection
    MsgBox "Application File Successfully Purged.", vbExclamation

End Sub
Private Function inetReady() As Boolean
        inetReady = Not Bimp.Inet2.StillExecuting
End Function

Any help would be greatly appreciated.

cheers

Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Are you sure you have delete permissions in that directory/on that file?
 
Hi Al42,

I do have delete permissons.

If I stop the app and then use my Cute FTP or something to log in to the site the file is gone so it is deleting it.

So I am not sure why it does not carry on with the script.

If I click the command button again it gives me an error saying that it is still processing the last command.

Any ideas.

Cheers

Symon

Everything has an answer, it's just knowing the right question to ask. !!!!
 
By "get stuck on the delete command", do you mean that you get an error? Or that it's taking a while? If the latter, how long is "a while"?

Have you tried running this code on another site?
 
For ftp I usually create a file wit hthe commands and exucte it. Means that the ftp stuff can be tested separately from the app and a record of the commands is left.

see this for a t-sql version - simpler from VB



======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Hi Al142,

I don't get an error message unless I have cliked the command button a second time.

There for it takes a while. How long I don't know, I have never left it that long.

I can't see how it could be the site being slow as it only takes a seconds or so to download a file from the site.

Any more ideas.

Cheers
Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Is it possible it is stuck in the first Do While Loop?
 
Hi bmdb,

Yeah I think that aswell, But it will only get stuck if Inet's state is still executing.

What I need to find out is why Inet is not changing state once it has deleted the file.

Any ideas.

Cheers

Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Do you have any error handling in your code? Maybe look at using the inet2.ResponseCode and inet2.ResponseInfo and see what if anything shows up. Maybe even throw in a msgbox to display the state of .StillExecuting just as a double check.
 
Have you fixed this yet and if so, what was the solution?
 
Sorry not fixed.

I have tested it by doing the following

Open new connection
delete file
close new connection

open another new connection
put file
close another new connection.

When I then Use CuteFTP to login to the ftp site the has been deleted but not uploaded.

I have tried the SEND command aswell and that makes no difference.

I cannot understand why I can connect and download, connect and delete, but cannot connect and upload.

It just does not make sense.

Cheers

Symon.

P.S There is a second thread on this where I posted the full code that I am using for both uploading and downloading. Forgot that this thread was still running. Sorry for the duplication.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Do you have rights to create in the target directory? Can you use CuteFTP and do this part manually as well?
 
Hi bmdb,

Yes I have full rights to the directory.

That is what I cannot understand.

I can do everything if i am logged in using CuteFTP just not through the ITC.

Cheers

Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
sborny,
As I stated in the somewhat duplicate post to this one I noticed an additional post buy you that indicates indirectly that you have gotten passed this particular problem. If this is the case please acknowledge such and provide us with your solution. Thanks.
 
Sorry again,

I have dropped the put statement and just deleted the file and then got the PHP script to recreate the file when the next form is submitted from the website.

Sorry for being a pain.

Cheers

Symon.

Everything has an answer, it's just knowing the right question to ask. !!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top