PDA

View Full Version : "Dim cWritableXMLCommentsFolder" means what????


robinreece
09-30-2004, 06:27 AM
I got this script for a photo gallery and the whole thing works except for the comment area. I don't know anything really about asp coding or even how to code html. Let me paste the piece of code that I THINK needs to be edited:

Dim cWritableXMLCommentsFolder
'set the folder where the xml comment files are going to be written.
cWritableXMLCommentsFolder=Server.Mappath(cVirtualPath)
'cWritableXMLCommentsFolder="d:\"

This is under the CONFIGURATION section. I'm guessing there is something in there that may also refer to another portion of the index.asp code but I just dont know.

Anyways, I created a folder in the main root folder called comments so this is where all of the xml comments would go. I tried several things:

Placed "d:\home\hnt17b040\photocatalog\comments" where it says Server.Mappath and that didn't work. When I try to enter a comment on the page www.u-turn.cc/photocatalog it comes up with an error: Error saving comment to d:\home\hnt17b040\photocatalog\"image_name.xml."
Error message: Access is denied.

Can someone please help me?? Here is the link to the entire script
http://www.iloire.com/vbscript/online_photo_catalog_vbscript.asp

Thanks
Robin

glenngv
09-30-2004, 07:30 AM
There is a permission problem. Give the IUSR_MACHINENAME account "Write" permission to the file. That account is the default account used when users surf your site.

robinreece
09-30-2004, 01:19 PM
I understand what giving permission is and I will ask my server to do that (what folder do I need to put write permission on??)_but I am not following what the IUSR_MACHINENAME is. Are you saying that I had it right by replacing
"cWritableXMLCommentsFolder=Server.Mappath(cVirtualPath)"
with
"cWritableXMLCommentsFolder=d:\home\hnt17b040\photocatalog\comments(cVirtualPath)"

Correction...

Ok... when I put d:\home\hnt17b040\photocatalog\comments where it says Server.Mappath as soon as I load index.asp it gives me the following error:

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/photocatalog/index.asp, line 30

Where am I supposed to put the d:\ thing??

'paths
Const cVirtualPath="images/" 'IMPORTANT: Set the images virtual folder (with the last "/")

Dim cWritableXMLCommentsFolder 'set the folder where the xml comment files are going to be written.
cWritableXMLCommentsFolder=Server.Mappath(cVirtualPath)
'cWritableXMLCommentsFolder="d:\"

glenngv
10-01-2004, 03:14 AM
Try this:

Dim cWritableXMLCommentsFolder 'set the folder where the xml comment files are going to be written.
'cWritableXMLCommentsFolder=Server.Mappath(cVirtualPath)
cWritableXMLCommentsFolder="d:\home\hnt17b040\photocatalog\comments\"

Regarding the Write permission, you set it to the file not to the folder. IUSR_<MACHINENAME> is the user account in the IIS server. You have to give that account Write permission to the XML file so that it has the right to modify the file.