View previous topic :: View next topic |
Author |
Message |
alexey.spb -
Joined: 02 Jul 2007 Posts: 17 Location: STP, Russia
|
Posted: Thu Jul 05, 2007 8:17 am Post subject: How to get variables that server POSTs using ASP |
|
|
Hi!
I know almost nothing about ASP that's why I would like to ask how to obtain server variables like
path
virtual_path
filename
and so on using ASP code for making script reflecting particular directory content?
I have tryed to use Request.ServerVariables ("path") but I didn't get current location, I got error message...
Thank all in advance! |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
|
alexey.spb -
Joined: 02 Jul 2007 Posts: 17 Location: STP, Russia
|
Posted: Thu Jul 05, 2007 5:14 pm Post subject: |
|
|
Thanx a lot!
Sorry for this stupid question!
Resolved. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jul 07, 2007 3:07 pm Post subject: |
|
|
alexey.spb,
You're welcome. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
alexey.spb -
Joined: 02 Jul 2007 Posts: 17 Location: STP, Russia
|
Posted: Wed Jul 11, 2007 6:33 pm Post subject: |
|
|
OK.
I would like create script as template for directory listing using ASP.
I'm doing this:
<BODY onLoad="msg()">
<form method="post" action="test.asp">
<input type=hidden name="FILE_FOLDER" value=path>
</form>
Goal of this is to get path variable that server POSTs.
And after that I'm trying to check value:
<div align="center"> <p class=TabHeader><%=FILE_FOLDER%></p><br><br></div>
Result is empty string. I misunerstood something definitely...
What I did wrong? |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Jul 12, 2007 10:25 pm Post subject: |
|
|
alexey.spb wrote: | <div align="center"> <p class=TabHeader><%=FILE_FOLDER%></p><br><br></div>
Result is empty string. I misunerstood something definitely...
What I did wrong? |
To get the variable FILE_FOLDER passed in the form, you should use Code: | Request.Form("FILE_FOLDER") | instead of _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
alexey.spb -
Joined: 02 Jul 2007 Posts: 17 Location: STP, Russia
|
Posted: Fri Jul 13, 2007 9:15 am Post subject: |
|
|
Sorry for annoying, but I'm still in trouble...
Let's change:
<%
Function StripFileName(strFile)
StripFileName = Left(strFile, inStrRev(strFile, "\"))
End Function
%>
<BODY>
<form method="post" action="test.asp">
<input type=hidden name="TEMP" value=path>
<%
FILE_FOLDER = StripFileName(Request.Form("TEMP"))
%>
</form>
I'm expecting to get string with current path (FILE_FOLDER) but I'm getting nothing...
Also:
Dim oFS, oFolder, oFile
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oFolder = oFS.getFolder(FILE_FOLDER) 'error: illegal argument!
Set objFolders = oFolder.SubFolders
Set objFiles = oFolder.Files
[/b] |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jul 14, 2007 2:38 pm Post subject: |
|
|
alexey.spb wrote: | Set oFolder = oFS.getFolder(FILE_FOLDER) 'error: illegal argument!
|
It seems that the value of FILE_FOLDER is not accepted by oFS.getFolder. This is a programming problem here and you'll probably have to debug your script to understand what FILE_FOLDER contains and why is that value not good for oFS.getFolder. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
alexey.spb -
Joined: 02 Jul 2007 Posts: 17 Location: STP, Russia
|
Posted: Fri Dec 28, 2007 1:23 pm Post subject: Variables that server POSTs to script... |
|
|
I would like to make one notice regarding things that was written in manual:
Quote: |
name1→ url1→ size1→ date1→ MIME-type1[CR]
[CR] represents the carriage return character (ASCII code 13 - \n)
|
This definition contains mistake - you can check it using InStr(chr13)) - it will be equal 0.
The same result gives InStr(vbCr). But server places LF symbol as end of the line.
This is minor bug but it is desirable that it should be fixed in manual :-) |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Jan 02, 2008 5:03 pm Post subject: Re: Variables that server POSTs to script... |
|
|
alexey.spb,
Thank you for pointing that out. On Windows, the lines are terminated by CR+LF whereas on other systems they are terminated by CR only. This is in accordance with each operating system end of line convention.
The documentation will be updated to reflect that. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|