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!

asp - filesystemobject

Status
Not open for further replies.

lee2k

Programmer
Aug 19, 2001
28
IN
Hi,
i have used FileSystemObject to create a folder in the server using an .ASP file. but when i run that asp file the browser keep processing something and there was no reply (either success or failure) from the server. i have set the Write permission for the particular port that im using. i have to sort out this problem. i really appreciate ur suggestions in this regard.
i need it badly.
-Lenin
 
Post your code please - where you think your error is happening

BDC.
 
when i call this function, the browser keep processing and returns nothing..
here is the code:
sub CreateTemp()
dim strFirmID,objMyFile,strPath
set objMyFile = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
strFirmID = Session("FIRMID")
strPath = Server.MapPath("/") & "\" & strFirmID & "\temp"
'response.write(objMyFile.FolderExists(strPath))
'response.end
if objMyFile.FolderExists(strPath)=true then objMyFile.DeleteFolder strPath
'response.write(&quot;<BR>file deleted&quot;)
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & &quot;\&quot; & strFirmID & &quot;\temp\1000&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & &quot;\&quot; & strFirmID & &quot;\temp\1000\1010&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & &quot;\&quot; & strFirmID & &quot;\temp\1000\1020&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & &quot;\&quot; & strFirmID & &quot;\temp\1000\1030&quot;
objMyFile.CreateFolder strPath
end sub
 
have you debugged the script yet?
response.write strPath

etc....

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
If your session is null, the path will ahve an extra slash in it. Try this, it write's the path to screen as onpnt suggests

<%
server.ScriptTimeout = 10
sub CreateTemp()
dim strFirmID,objMyFile,strPath
set objMyFile = Server.CreateObject(&quot;SCRIPTING.FILESYSTEMOBJECT&quot;)
strFirmID = Session(&quot;FIRMID&quot;)
linkconnect = &quot;&quot;
If strFirmID<>&quot;&quot; then linkconnect=&quot;\&quot;
strPath = Server.MapPath(&quot;/&quot;) & strFirmID & &quot;\temp&quot;
response.write(strPath)
'response.write(objMyFile.FolderExists(strPath))
'response.end
if objMyFile.FolderExists(strPath)=true then objMyFile.DeleteFolder strPath
'response.write(&quot;<BR>file deleted&quot;)
strPath = Server.MapPath(&quot;/&quot;) & linkconnect & strFirmID & &quot;\temp&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & linkconnect & strFirmID & &quot;\temp\1000&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;)& linkconnect & strFirmID & &quot;\temp\1000\1010&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;) & linkconnect & strFirmID & &quot;\temp\1000\1020&quot;
objMyFile.CreateFolder strPath
strPath = Server.MapPath(&quot;/&quot;)& linkconnect & strFirmID & &quot;\temp\1000\1030&quot;
objMyFile.CreateFolder strPath
end sub
CreateTemp()
%>

This works for me.

BDC.
 
Is it running and not timing out after the standard 90 seconds?
If so I bet your running Norton :)
Try turning off script blocking in NAV.

Of course I could be way off, but I remember how long it took me to find this solution a year+ ago, so now I give it away free every chance I get :p

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Do you know how hot your computer is running at home? I do
 
which has been the answer for I think five problems this week thus far. [wink]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
hi,
the path is correct. no problem in it.
i have turned off the Script Blocking in the Server.
i have set read/write permissions. etc.
but still the code is not working.
i tried in many ways. im also looking for this type of process for the past 6 months. nothing works out. pls help me.
thanks in advance.
-Lenin
 
hi,
im really sorry. it works fine.
Thanks a lot to everyone.
pls forget the previous message that i sent.
once thank u very much.
-Lenin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top