473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASP Script Hangs

Hi folks,

Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro, SP2,
IIS 5.1) the ASP hangs - it produces no output, not even an error. Can
anyone offer any assistance on what I might need to do to get it working
correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi
Jul 22 '05 #1
8 1282
Change strCurrentFolder to Server.MapPath(strCurrentFolder)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Andi B" <mg****@dsl.pipex.com> wrote in message news:42***********************@news.dial.pipex.com ...
Hi folks,

Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro, SP2,
IIS 5.1) the ASP hangs - it produces no output, not even an error. Can
anyone offer any assistance on what I might need to do to get it working
correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi



Jul 22 '05 #2
"Andi B" wrote in message
news:42***********************@news.dial.pipex.com ...
: For Each objFile in strCurrentFolder.Files

for each objFile in objFolder.Files

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #3
permissions perhaps? The user that IIS is running under doesn't have
permission to either the files/folder OR to the FileSsystemObject (most
likely this).

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Andi B" <mg****@dsl.pipex.com> wrote in message
news:42***********************@news.dial.pipex.com ...
Hi folks,

Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro,
SP2, IIS 5.1) the ASP hangs - it produces no output, not even an error.
Can anyone offer any assistance on what I might need to do to get it
working correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi

Jul 22 '05 #4
For this test, I have set the IUSR account permissions to Full Control, and
still nothing happens. I'm not sure how I can change the accounts permission
to access the FileSystemObject though.

Regards,

Andi

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
permissions perhaps? The user that IIS is running under doesn't have
permission to either the files/folder OR to the FileSsystemObject (most
likely this).

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Andi B" <mg****@dsl.pipex.com> wrote in message
news:42***********************@news.dial.pipex.com ...
Hi folks,

Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo
of themselves to their profile on the page. The photos are uploaded to
the webserver by an ASP script. I am now trying to get an addition
written which allows for the deletion of old files that are no longer
used by anyones profile. I have written the following to list the
contents of the folder, but whenever I test the script on my home
computer (WinXP Pro, SP2, IIS 5.1) the ASP hangs - it produces no output,
not even an error. Can anyone offer any assistance on what I might need
to do to get it working correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi


Jul 22 '05 #5
Are you sure it is hanging or could it just not be producing any output?
What does view source show?

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Andi B" <mg****@dsl.pipex.com> wrote in message
news:42***********************@news.dial.pipex.com ...
Hi folks,

Wondering if anyone can help me - I have recently set up a website on our
work intranet, which allows staff members in our team to attach a photo of
themselves to their profile on the page. The photos are uploaded to the
webserver by an ASP script. I am now trying to get an addition written
which allows for the deletion of old files that are no longer used by
anyones profile. I have written the following to list the contents of the
folder, but whenever I test the script on my home computer (WinXP Pro,
SP2, IIS 5.1) the ASP hangs - it produces no output, not even an error.
Can anyone offer any assistance on what I might need to do to get it
working correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi

Jul 22 '05 #6
"Roland Hall" wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
: "Andi B" wrote in message
: news:42***********************@news.dial.pipex.com ...
:: For Each objFile in strCurrentFolder.Files
:
: for each objFile in objFolder.Files

Actually you have more than one error. FSO expects a physical path, not
virtual. You need Server.MapPath and my first suggestion.
I just tried this and it works. Just change the name of your folders. I'm
using "/images"

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = Server.MapPath("/images")

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in objFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

http://kiddanger.com/lab/files3.asp

--
Roland Hall
- some days are easier than others -

/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Jul 22 '05 #7
If you have antivirus tools installed. such as Norton AV, try disable script
blocking........

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/
"Andi B" <mg****@dsl.pipex.com> wrote in message
news:42***********************@news.dial.pipex.com ...
For this test, I have set the IUSR account permissions to Full Control,
and still nothing happens. I'm not sure how I can change the accounts
permission to access the FileSystemObject though.

Regards,

Andi

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...
permissions perhaps? The user that IIS is running under doesn't have
permission to either the files/folder OR to the FileSsystemObject (most
likely this).

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Andi B" <mg****@dsl.pipex.com> wrote in message
news:42***********************@news.dial.pipex.com ...
Hi folks,

Wondering if anyone can help me - I have recently set up a website on
our work intranet, which allows staff members in our team to attach a
photo of themselves to their profile on the page. The photos are
uploaded to the webserver by an ASP script. I am now trying to get an
addition written which allows for the deletion of old files that are no
longer used by anyones profile. I have written the following to list the
contents of the folder, but whenever I test the script on my home
computer (WinXP Pro, SP2, IIS 5.1) the ASP hangs - it produces no
output, not even an error. Can anyone offer any assistance on what I
might need to do to get it working correctly?

<%@ Language=VBScript %>

<%
Option Explicit
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = "images/staff"

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in strCurrentFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

Thanks in advance of any assistance,

Andi



Jul 22 '05 #8
Sir you are a genius. Just tested this code and it works brilliantly, thank
you very much!

I can't promise that I won't be back asking for more help, but in the mean
time, thank you.

Regards,

Andi

"Roland Hall" <nobody@nowhere> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"Roland Hall" wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
: "Andi B" wrote in message
: news:42***********************@news.dial.pipex.com ...
:: For Each objFile in strCurrentFolder.Files
:
: for each objFile in objFolder.Files

Actually you have more than one error. FSO expects a physical path, not
virtual. You need Server.MapPath and my first suggestion.
I just tried this and it works. Just change the name of your folders.
I'm
using "/images"

<%@ Language=VBScript %>
<%
Option Explicit
Response.Buffer = True

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Dim objFolder

Dim strCurrentFolder
strCurrentFolder = Server.MapPath("/images")

Set objFolder = objFSO.GetFolder(strCurrentFolder)

Dim objFile

For Each objFile in objFolder.Files
Response.Write objFile.Name & " (" & objFile.Size & "bytes)<br>"
Next

Set objFSO = Nothing
Set objFolder = Nothing
%>

http://kiddanger.com/lab/files3.asp

--
Roland Hall
- some days are easier than others -

/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */

Jul 22 '05 #9

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

Similar topics

1
by: Benoit Fries | last post by:
Hello, I have some problems with a Javascript that should redirect me to another page, it works fine most of the times but sometimes it hangs on a blank page. I made lots of tests and finally...
6
by: Alexander Widera | last post by:
hello, if i start a program (an exe-file) with Process.Start(...) I don't have the required permissions that the programm needs (i could start the programm but the program needs special rights)....
2
by: Gerard Flanagan | last post by:
Hello, I have a third party shell script which updates multiple environment values, and I want to investigate (and ultimately capture to python) the environment state after the script has run....
10
by: Ohmster | last post by:
I am trying to use this cool script that some MIT guy wrote and it just does not work, I get a stream of errors when I try to run it. It is supposed to visit a URL and snag all of the pictures on...
2
by: Jay | last post by:
I have a web app running on the windows CE device. In one of the asp.net pages - it has javascript code. That seems to have a memory leak. When I run the web app - in about one hour, the app hangs....
0
by: norseman | last post by:
Gros Bedo wrote: ============================== Yes. man ps explains try ps -AFL | grep then kill -9 found (check it more than twice) 1) If your script is known to hang use what...
2
by: kj | last post by:
Hi! I have a Pythonoob question. I have a script that hangs indefinitely at random times; the only thing to do at this point is to kill it. I'm looking for suggestions on how to troubleshoot...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
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...

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.