Forum Moderators: open
I used the following code to try to create my drop down but I get an 'Object Required' error displayed instead of the list of files in my admin/uploads folder. Please can you give me some pointers as to why this is happening. I'm new to this stuff and it's driving me crazy
I am using
<%
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
Set objFold=objFSO.GetFolder("E:\admin\uploads")
Set objFiles=objFold.Files
%>
and then generating my drop down using
<select name="productThumb" id="productThumb">
<option><%For Each objFile in objFolder.Files
objFile.Name
Next
%></option>
</select>
Thank you in anticipation
Jules
Please, how do I change the following so that each name appears on its own line in the drop down and not as one long string! Thanks
<select name="productThumb" id="productThumb">
<option selected>
<%
For Each objFile in objFold.Files
Response.Write objFile.Name & "<br>"
Next
%>
<select name="productThumb" id="productThumb">
<option selected>
<%
For Each objFile in objFold.Files
Response.Write "<option value=""" & objFile.Name & """>" & objFile.Name & "</option>"
Next
%>