1. Registered User
Join Date
Jan 2004
Posts
30

On my computer I get filename and this work fine bu on server of my host I get null value :-(.

What's wrong, can my host setup this correctly or what?
Thank you.

Source:
<%
Set fso = CreateObject("Scripting.ileSystemObject")
Set folder = fso.GetFolder(Server.Mappath("\pictures\big"))
Set files = folder.Files

For Each file in Files
IF LEFT(rsArtikal.Fields.Item("Slika").Value, LEN(rsArtikal.Fields.Item("Slika").Value)-4) = LEFT(file.NAME,LEN(file.Name)-4) THEN%>

<%
END IF
Next
Set files = folder.Files
et file = Nothing
Set fso = Nothing %>

2. Registered User
Join Date
Jun 2003
Location
Ohio
Posts
108
try change both values to uppercase before comparing them. The comparison that you are doing is case sensetive.

You can easily figure out if it is working by outputting both values to the screen to see if they are correct. If they are not correct, then there is your problem. If it is correct, then you problem lies elsewhere in your code.

Nothing more we can help you with now. It is all you.

3. Registered User
Join Date
Nov 2003
Location
Christchurch, New Zealand
Posts
1,619
This won't help with your current problem, but might I suggest this change... instead of
Code:
For Each file in Files
IF LEFT(rsArtikal.Fields.Item("Slika").Value, LEN(rsArtikal.Fields.Item("Slika").Value)-4) = LEFT(file.NAME,LEN(file.Name)-4) THEN%>

<%
END IF
Next
try...
Code:
recordName = LEFT(rsArtikal.Fields.Item("Slika").Value, LEN(rsArtikal.Fields.Item("Slika").Value)-4)
For Each file in Files
IF LEFT(recordName = LEFT(file.NAME,LEN(file.Name)-4) THEN%>
<%
END IF
Next
or something close to that (haven't checked the syntax). Basically take that first left bit out of the file loop....

4. Registered User
Join Date
Jan 2004
Posts
30
No, the problem isn't in the code.

Simly on hosting server the code doesn't return value file.Name, I have try with

Response.Write(file.Name)

almost on every part of code :-(.
And on my computer works just fine.

Hm....

5. Registered User
Join Date
Nov 2003
Location
Christchurch, New Zealand
Posts
1,619
I wasn't suggesting it was. You should read my reply, understand what it says and then reply....

The answer to your problem is (most likely) that you are running into a permissioning problem where the user that you are running IIS as does not have access to the correct files, or alternatively that functions such as Server.MapPath have not been enabled on the server or that parent paths have not been enabled on the server or something similar....

The reason I didn't give this answer is because it normally results in futher questions like "help, how do I check all of this" and I really don't have the time to go through it all.

The suggested code change below is to stop you constantly redoing a calculation that will not change during the process you have shown.

6. Registered User
Join Date
Jan 2004
Posts
30
Sorry Rockslide, I understand your previous answer and thank you for suggestion.

My reply was to thele, sorry one more time.
Thank you.
Last edited by dove_g; 04-20-04 at 03:17.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•