|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems with ASP and fs.CreateTextFile
I have an asp page that does several things in a row:
1) Add form data to a database 2) Create a folder at a specific address on the server 3) Then create an index.asp page within that folder The problem is with step 3 - sometime it works but often it errors with Path Not Found when trying to create the text (index.asp) file. I've done a Response.Write to make sure that the location it is trying to create the file in is correct and it is. Could it be an issue with lag; the folder not being created quickly enough before the text file is attempting to create within it??? |
|
#2
|
||||
|
||||
|
I doubt it's lag - the createfolder method shouldn't finish until the folder is created.
When creating anything like files or folders, you should always check their existance first by using either: objFso.FolderExists(foo) or objFso.FileExists(foo) This will show if if there's a problem. I assume you've also got all your permissions setup correctly? |
|
#3
|
|||
|
|||
|
I tried that testing method by testing to see if the folder was created before trying to create the file within it but it threw the same error suggesting that the folder did indeed exist. Checked all permissions etc - the really wierd fact is that the problem seems to be intermitent!
|
|
#4
|
|||
|
|||
|
maybe left field answer, but I seem to have a lot success with the OpenTextFile method with the with the create part set to True in cases like these.
Does this help?
__________________
- Rogier Doekes |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Problems with ASP and fs.CreateTextFile |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|