473,835 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

All the sessions reset when run copy folder or file


I have very weird problem on my server, when I run this function:
Expand|Select|Wrap|Line Numbers
  1. Sub TransferFiles(departTemp_id,depart_id)
  2. 'Copy the files to the depart from the template
  3. '--
  4. Dim objFolder
  5. Dim objFSO
  6. Dim objFile
  7. Dim oFolder
  8. '--
  9. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  10. 'Get the folder object associated with the directory
  11. Set objFolder = objFSO.GetFolder(server.mappath("/
  12. image/"&departTemp_id&""))
  13. 'Loop through the Files collection
  14. For Each objFile in objFolder.Files
  15. if Not objFSO.FileExists(server.mappath("/
  16. image/"&depart_id&"/"&objFile.Name&"")) then
  17. objFSO.CopyFile server.mappath("/
  18. image/"&departTemp_id&"/"&objFile.Name&""),server.mappath("/
  19. image/"&depart_id&"/"&objFile.Name&""),False
  20. End If
  21. Next
  22. 'Loop through the Folder collection
  23. For Each oFolder in objFolder.SubFolders
  24. if Not objFSO.FolderExists(server.mappath("/
  25. image/"&depart_id&"/"&oFolder.Name&"")) then
  26. objFSO.CopyFolder server.mappath("/
  27. image/"&departTemp_id&"/"&oFolder.Name&""),server.mappath("/
  28. image/"&depart_id&"/"&oFolder.Name&""),False
  29. End If
  30. Next
  31. 'Clean up!
  32. Set objFolder    = Nothing
  33. Set objFile        = Nothing
  34. Set objFSO        = Nothing
  35. End Sub
All the sessions of all users that in my website as end.

This is very weird,
I'm using ASP on windows server 2003 str with IIS 6.

Can any one help me with that?

Mar 9 '07 #1
1 2494
It sounds like the application is getting reset. Does the code
complete i.e. could it be failing half way through, causing a bad
error and resetting the IIS app? Is there anything in the event log or
an IIS 500 error in the web log?

Robert Chafer

jo******@gmail. com wrote:

I have very weird problem on my server, when I run this function:
Expand|Select|Wrap|Line Numbers
  1.  Sub TransferFiles(departTemp_id,depart_id)
  2.  'Copy the files to the depart from the template
  3.  '--
  4.  Dim objFolder
  5.  Dim objFSO
  6.  Dim objFile
  7.  Dim oFolder
  8.  '--
  9.  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  10.  'Get the folder object associated with the directory
  11.  Set objFolder = objFSO.GetFolder(server.mappath("/
  12.  image/"&departTemp_id&""))
  13.  'Loop through the Files collection
  14.  For Each objFile in objFolder.Files
  15.      if Not objFSO.FileExists(server.mappath("/
  16.  image/"&depart_id&"/"&objFile.Name&"")) then
  17.          objFSO.CopyFile server.mappath("/
  18.  image/"&departTemp_id&"/"&objFile.Name&""),server.mappath("/
  19.  image/"&depart_id&"/"&objFile.Name&""),False
  20.      End If
  21.  Next
  22.  'Loop through the Folder collection
  23.  For Each oFolder in objFolder.SubFolders
  24.      if Not objFSO.FolderExists(server.mappath("/
  25.  image/"&depart_id&"/"&oFolder.Name&"")) then
  26.          objFSO.CopyFolder server.mappath("/
  27.  image/"&departTemp_id&"/"&oFolder.Name&""),server.mappath("/
  28.  image/"&depart_id&"/"&oFolder.Name&""),False
  29.      End If
  30.  Next
  31.  'Clean up!
  32.  Set objFolder    = Nothing
  33.  Set objFile        = Nothing
  34.  Set objFSO        = Nothing
  35.  End Sub

All the sessions of all users that in my website as end.

This is very weird,
I'm using ASP on windows server 2003 str with IIS 6.

Can any one help me with that?

Rob Chafer
Mar 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Dave Mateer | last post by:
Hi Why does the following code allow me to keep the same session when in the same sub domain (ie admin.localhost), yet not when I goto another related domain eg main.localhost? I would like to have the same session on the related domain. I bet the solution is really simple <grin>!... Kind Regards
by: Marcus | last post by:
Hi All, First, just wanted to say that I found what I thought was a very helpful tutorial on sessions in case anyone out there has questions on them: http://www.free2code.net/tutorials/programming/php/4/sessions.php I've been using sessions for quite some time but only after reading this do I really understand what is going on on both the client and server side.
by: Ik Ben Het | last post by:
Hello, I posted a simular question in the "IIS Security" group but it think it is more usefull to post it here. I want to do something very simpel. Make a part of my website available only for users with a username and password. The site is mainly ASP based. The webserver is an IIS6 and I do NOT have access to server settings (session timeout, security,...).
by: Ron Vecchi | last post by:
I know this has been asked before but I out of all the posts I've read regarding using Directory.Move and then the application restarting itself I have found no answer except that Sessions are buggy or that you should create a new folder then copy the content of the old into it and then delete the old one...pretty lame for such a simple IO action. Can microsoft give an answer to how to fix this or is this just a know bug... that will...
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I have to click it twice to do the job (the first submit resets the sessions but this it too late to change the field values, which requires another submit to pick up the new session values). Problem is I cant think how to accomplish the resetting of...
by: AlonR | last post by:
Hi, We're experiencing random user sessions losses on our web applications, and are researching for any useful information which may shed light on this problem. Environment: In our company, we're developing a web product based on ASP.NET 2.0, in conjunction with Oracle database over ADO.NET and external COM objects
by: comp.lang.php | last post by:
I am in the middle of debugging a script that is hanging on "session_start()", which, if I recall, can occur if session.save_path points to a directory onto which you do not have permission to access (I verified and yep, no love on that folder). So I figured I'd simply rewrite session.save_path: <? ini_set('session.save_path', '/path/where/there/is/love'); ?> To no avail, because the shared hosting provider also informed me that
by: Jon Slaughter | last post by:
Any pitfalls or stuff I need to worry about when working with sessions? I want to write a log file and hit counter along with a login interface and I'm trying to learn this stuff. http://us.php.net/session Just wondering if theres anything that I need to keep in mind while I work on it? Thanks,
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. Can I use a strong named DLL outside the GAC with Copy Local = false by providing a reference to the public key? If yes to above, please tell me how to reference the public key within
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.