Solved

wininet.dll's FTP deletefile function

Posted on 2001-07-08
3
859 Views
Last Modified: 2008-02-01
I've been using wininet.dll to retrieve FTP files from an IIS server without any problem. But if I use it to delete FTP files, I get a successful return message (or no error message) but the files are not deleted. Though the FTP files are still there, it behaves that it has been 'locked' up that you can't do anything with it anymore.

I try to delete it again or move it using different FTP utilities (WS, CuteFTP, FTP in the command prompt) I couldn't delete or move it anymore I get a 'no permission error'. Even if i try to login interactively on the IIS server using an Admin account and try to delete from the servers local drive, I still can't delete or move it.

My only workaround is to restart the server and delete it again from the server's local drive.

My FTP account has sufficient rights to delete the FTP file because I can delete the file with different FTP utilities before it gets 'locked' by wininet.dll' deletefile function.

I'm using VB6 on NT4 Workstation SP6 as my client, the IIS server is an NT4 Server (i believe it has SP5 or SP6). I would really appreciate it if someone can tell me a solution for this and perhaps explain to me why its happening.
0
Comment
Question by:derjim929
3 Comments
 

Expert Comment

by:bppraveen001
ID: 6264592
Hello derjim929,
     I wrote my own FTP application by using INet Control and I had the same problem as you are facing, I overcome that problem by using the following code: (StillExecuting is a property of INet control which indicates wheather the INet control is still executing the old command or is it ready to execute next command)

     Private Sub Wait()
          Do While Inet1.StillExecuting
               DoEvents
          Loop
     End Sub

      In the above function I am looping till the StillExecuting property has "True" value.

      I think if you do the same thing it will work....

       Why you need to do is, when ever you issue any commands to the FTP server to do it takes some time. If we don't call the above function after issuing some of the FTP commands (like Upload, Download, Delete etc.,), our application will execute remaining line of code for that we feel as if everything is worked fine, but it need some time to perform fully. When ever FTP is dealing with any particular file it will not allow any other FTP application to access that file till it completes the task (basically like Session Variables in ASP till that session is over it will not allow you to access that file after the session time is over you can do what ever you want) , by this time you are trying to delete the same file by using some other FTP application and it is unable to delete the file and throwing the error.

bpp
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7148204
Hi derjim929,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

derjim929, Please DO NOT accept this comment as an answer.
    **** if bppraveen001's suggestion worked, accept IT as an answer
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7178959
Placed in PAQ

Computer101
E-E Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now