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 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
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
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
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
"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. */
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
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. */
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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)....
|
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....
|
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...
|
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....
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
| |