mike55 Posted August 31, 2005 Posted August 31, 2005 Hi, Am trying to delete a file on the web server. This particular file has been downloaded from the server to my local machine. I had been using the command: File.Delete("C:\Temp\test.txt") But this does not seem to be deleting the file. Any suggestions?? Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Administrators PlausiblyDamp Posted August 31, 2005 Administrators Posted August 31, 2005 Are you running this code on the client or the web server? Is the path on the client or the web server? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
mike55 Posted August 31, 2005 Author Posted August 31, 2005 Thanks for the reply PlausiblyDamp, I found the solution to my problem. Here's what I was doing: 1. Retrieve all my data from the database and write it to a .CSV file. 2. Offer the user the choice of either Saving, Opening or Cancel the .CSV file. 3. Whatever option the user selected, I would then delete the .CSV file from my web server. The problem is that when the "Save, Open, Cancel" dialog appeared, no other code would run after that. So here is what I did, 1. Use a file stream to read the data from the .CSV file. 2. Delete the file on the web server. 3. Write the data in the file stream to the users location if they choose the Save or Open option. Mike55. Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.